Add tests for ticket validity and event date formatting

- Create TicketValiditySchemaTest to verify database schema for ticket validity.
- Update CatalogModelsTest to include tests for event date attributes and selection options.
- Introduce EventDateTextFormatterTest for formatting event dates in Spanish.
- Refactor EventModelsTest to include validity time relationships.
- Add SaleDetailResourceTest to ensure correct serialization of purchase items.
- Enhance TicketTest with validity time checks and status management.
- Implement ValidityTimeResourceTest to validate resource output for different validity types.
- Add ValidityTimeTest to verify casting and validity checks for validity time types.
This commit is contained in:
2026-08-11 12:41:35 -03:00
parent b294e5c46e
commit 02cf3f3773
166 changed files with 10203 additions and 1849 deletions

View File

@@ -24,6 +24,7 @@ class CatalogSchemaTest extends TestCase
$this->assertFalse(Schema::hasTable('bundle_items'));
$this->assertTrue(Schema::hasTable('variantes'));
$this->assertTrue(Schema::hasTable('item_attributes'));
$this->assertTrue(Schema::hasColumn('item_attributes', 'sort_order'));
$this->assertTrue(Schema::hasTable('variant_values'));
}
@@ -31,9 +32,8 @@ class CatalogSchemaTest extends TestCase
{
$this->assertEqualsCanonicalizing([
'id',
'validity_time_id',
'tenant_code',
'event_id',
'event_product_type',
'category_id',
'brand_id',
'inventory_id',
@@ -43,9 +43,10 @@ class CatalogSchemaTest extends TestCase
'descripcion',
'precio',
'inventory_policy',
'max_units_per_user',
'has_tickets',
'maximum_use_date',
'minimum_use_date',
'ticket_generation_policy',
'validity_time_id',
], Schema::getColumnListing('catalog_items'));
}
@@ -183,26 +184,25 @@ class CatalogSchemaTest extends TestCase
{
$this->assertTrue(Schema::hasColumns('variantes', [
'event_date_id',
'minimum_use_date',
'maximum_use_date',
]));
}
public function test_events_and_event_dates_are_linked_to_the_catalog(): void
public function test_event_configuration_and_dates_belong_to_the_tenant(): void
{
$this->assertFalse(Schema::hasTable('events'));
$this->assertTrue(Schema::hasColumns('tenants', [
'event_title',
'event_location',
'event_date_text',
]));
$this->assertEqualsCanonicalizing([
'id',
'tenant_code',
'name',
'address',
], Schema::getColumnListing('events'));
$this->assertEqualsCanonicalizing([
'id',
'event_id',
'date',
'time_start',
'time_end',
], Schema::getColumnListing('event_dates'));
$this->assertTrue(Schema::hasColumn('tenants', 'active_event_id'));
$this->assertFalse(Schema::hasColumn('catalog_items', 'event_id'));
$this->assertFalse(Schema::hasColumn('compras', 'event_id'));
}
}