feat(seeders): update FiestaFutbolInfantil seeders and tests to include new categories and menu items

This commit is contained in:
2026-08-06 14:12:58 -03:00
parent b294e5c46e
commit 7f01adab73
4 changed files with 88 additions and 42 deletions

View File

@@ -175,7 +175,7 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
$this->assertSame(9, CatalogItem::query()->where('tenant_code', $tenant->codigo)->count());
$this->assertSame(10, Inventory::query()->count());
$this->assertSame(
['Bebidas', 'Comidas', 'Entradas', 'Estacionamiento', 'Gastronomía'],
['Alojamientos', 'Comida', 'Entradas', 'Merchandising'],
Category::query()
->where('tenant_code', $tenant->codigo)
->orderBy('nombre')
@@ -183,10 +183,10 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
->all(),
);
$this->assertSame(
'Estacionamiento',
'Merchandising',
CatalogItem::query()
->where('tenant_code', $tenant->codigo)
->where('slug', 'estacionamiento-auto')
->where('slug', 'remera-oficial')
->with('category')
->sole()
->category
@@ -202,9 +202,9 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
$this->assertSame(
[
'Entradas' => ['entrada-general', 'entrada-general-todos-los-dias'],
'Estacionamiento' => ['estacionamiento-auto', 'estacionamiento-moto'],
'Comidas' => ['hamburguesa-papa-frita', 'pancho', 'combo-2-panchos-2-hamburguesas'],
'Bebidas' => ['coca-cola-500ml', 'agua-mineral-1l'],
'Alojamientos' => ['alojamiento-por-noche', 'alojamiento-fin-de-semana'],
'Merchandising' => ['remera-oficial', 'gorra-oficial'],
'Comida' => ['hamburguesa-papa-frita', 'pancho', 'combo-2-panchos-2-hamburguesas'],
],
$featuredGroups
->mapWithKeys(fn (FeaturedGroup $group): array => [
@@ -216,9 +216,9 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
$this->assertSame(
[
['Entradas', FeaturedGroupSource::Category, 'Entradas', ProductLayout::Row, GroupLayout::SimpleVertical, 0],
['Estacionamiento', FeaturedGroupSource::Category, 'Estacionamiento', ProductLayout::ColumnWithCart, GroupLayout::Simple, 1],
['Comidas', FeaturedGroupSource::Category, 'Comidas', ProductLayout::ColumnWithCart, GroupLayout::Simple, 2],
['Bebidas', FeaturedGroupSource::Category, 'Bebidas', ProductLayout::ColumnWithCart, GroupLayout::Simple, 3],
['Alojamientos', FeaturedGroupSource::Category, 'Alojamientos', ProductLayout::ColumnWithCart, GroupLayout::Simple, 1],
['Merchandising', FeaturedGroupSource::Category, 'Merchandising', ProductLayout::ColumnWithCart, GroupLayout::Simple, 2],
['Comida', FeaturedGroupSource::Category, 'Comida', ProductLayout::ColumnWithCart, GroupLayout::Simple, 3],
],
$featuredGroups
->map(fn (FeaturedGroup $group): array => [

View File

@@ -20,6 +20,7 @@ class MenuSeederTest extends TestCase
public function test_it_seeds_the_admin_menus(): void
{
$tenant = $this->createTenant('admin_tenant');
$fiestaTenant = $this->createTenant('fiesta_futbol_infantil');
$this->seed(MenuSeeder::class);
@@ -31,6 +32,12 @@ class MenuSeederTest extends TestCase
'adminapp.staff' => ['Staff', '/admin/staff'],
'adminapp.ventas' => ['Ventas', '/admin/ventas'],
];
$fiestaCategoryMenus = [
'adminapp.fiesta-futbol-infantil.entradas' => ['Entradas', '/admin/entradas'],
'adminapp.fiesta-futbol-infantil.alojamientos' => ['Alojamientos', '/admin/alojamientos'],
'adminapp.fiesta-futbol-infantil.merchandising' => ['Merchandising', '/admin/merchandising'],
'adminapp.fiesta-futbol-infantil.comida' => ['Comida', '/admin/comidas'],
];
$adminApp = Menu::query()
->with('children')
@@ -41,7 +48,7 @@ class MenuSeederTest extends TestCase
$this->assertSame(Menu::CONTENT_TYPE_DYNAMIC, $adminApp->content_type);
$this->assertSame('/', $adminApp->route);
$this->assertSame(
array_keys($expectedMenus),
array_keys([...$expectedMenus, ...$fiestaCategoryMenus]),
$adminApp->children->pluck('code')->sort()->values()->all()
);
$this->assertTrue(
@@ -64,6 +71,16 @@ class MenuSeederTest extends TestCase
);
}
foreach ($fiestaCategoryMenus as $code => [$label, $route]) {
$menu = Menu::query()->where('code', $code)->firstOrFail();
$this->assertSame($label, $menu->label);
$this->assertSame($route, $menu->route);
$this->assertSame('main.adminapp', $menu->parent_menu_code);
$this->assertFalse($tenant->menues()->where('menues.code', $code)->exists());
$this->assertTrue($fiestaTenant->menues()->where('menues.code', $code)->exists());
}
$this->assertFalse(
Menu::query()->whereIn('code', [
'admin.event',