fix: define featured group codes in seeders
This commit is contained in:
parent
dc33e5dc09
commit
8ed8a11b7b
|
|
@ -191,6 +191,7 @@ class DesfilePuraTendenciaSeeder extends Seeder
|
||||||
|
|
||||||
FeaturedGroup::query()->create([
|
FeaturedGroup::query()->create([
|
||||||
'tenant_code' => self::TENANT_CODE,
|
'tenant_code' => self::TENANT_CODE,
|
||||||
|
'code' => 'entradas',
|
||||||
'source_type' => FeaturedGroupSource::All,
|
'source_type' => FeaturedGroupSource::All,
|
||||||
'category_id' => null,
|
'category_id' => null,
|
||||||
'product_layout' => ProductLayout::TicketSelector,
|
'product_layout' => ProductLayout::TicketSelector,
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ class FiestaFutbolInfantilProductSeeder extends Seeder
|
||||||
|
|
||||||
FeaturedGroup::query()->create([
|
FeaturedGroup::query()->create([
|
||||||
'tenant_code' => $tenant->codigo,
|
'tenant_code' => $tenant->codigo,
|
||||||
|
'code' => 'productos',
|
||||||
'source_type' => FeaturedGroupSource::All,
|
'source_type' => FeaturedGroupSource::All,
|
||||||
'category_id' => null,
|
'category_id' => null,
|
||||||
'product_layout' => ProductLayout::Row,
|
'product_layout' => ProductLayout::Row,
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ class ProductCatalogFromImagesSeeder extends Seeder
|
||||||
|
|
||||||
FeaturedGroup::query()->create([
|
FeaturedGroup::query()->create([
|
||||||
'tenant_code' => $tenant->codigo,
|
'tenant_code' => $tenant->codigo,
|
||||||
|
'code' => 'productos',
|
||||||
'source_type' => FeaturedGroupSource::All,
|
'source_type' => FeaturedGroupSource::All,
|
||||||
'product_layout' => ProductLayout::ColumnWithImage,
|
'product_layout' => ProductLayout::ColumnWithImage,
|
||||||
'group_layout' => GroupLayout::Paginated,
|
'group_layout' => GroupLayout::Paginated,
|
||||||
|
|
@ -180,6 +181,7 @@ class ProductCatalogFromImagesSeeder extends Seeder
|
||||||
|
|
||||||
$carouselGroup = FeaturedGroup::query()->create([
|
$carouselGroup = FeaturedGroup::query()->create([
|
||||||
'tenant_code' => $tenant->codigo,
|
'tenant_code' => $tenant->codigo,
|
||||||
|
'code' => 'productos-destacados',
|
||||||
'source_type' => FeaturedGroupSource::Manual,
|
'source_type' => FeaturedGroupSource::Manual,
|
||||||
'product_layout' => ProductLayout::ColumnWithImage,
|
'product_layout' => ProductLayout::ColumnWithImage,
|
||||||
'group_layout' => GroupLayout::Carousel,
|
'group_layout' => GroupLayout::Carousel,
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ class CatalogSchemaTest extends TestCase
|
||||||
$this->assertEqualsCanonicalizing([
|
$this->assertEqualsCanonicalizing([
|
||||||
'id',
|
'id',
|
||||||
'tenant_code',
|
'tenant_code',
|
||||||
|
'code',
|
||||||
'source_type',
|
'source_type',
|
||||||
'category_id',
|
'category_id',
|
||||||
'product_layout',
|
'product_layout',
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ class DesfilePuraTendenciaSeederTest extends TestCase
|
||||||
]);
|
]);
|
||||||
$this->assertDatabaseHas('featured_groups', [
|
$this->assertDatabaseHas('featured_groups', [
|
||||||
'tenant_code' => 'desfile_pura_tendencia',
|
'tenant_code' => 'desfile_pura_tendencia',
|
||||||
|
'code' => 'entradas',
|
||||||
'source_type' => 'all',
|
'source_type' => 'all',
|
||||||
'product_layout' => 'ticket_selector',
|
'product_layout' => 'ticket_selector',
|
||||||
'group_layout' => 'single',
|
'group_layout' => 'single',
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,7 @@ class FiestaFutbolInfantilProductSeederTest extends TestCase
|
||||||
));
|
));
|
||||||
|
|
||||||
$featuredGroup = FeaturedGroup::query()->where('tenant_code', $tenant->codigo)->sole();
|
$featuredGroup = FeaturedGroup::query()->where('tenant_code', $tenant->codigo)->sole();
|
||||||
|
$this->assertSame('productos', $featuredGroup->code);
|
||||||
$this->assertSame(FeaturedGroupSource::All, $featuredGroup->source_type);
|
$this->assertSame(FeaturedGroupSource::All, $featuredGroup->source_type);
|
||||||
$this->assertSame(ProductLayout::Row, $featuredGroup->product_layout);
|
$this->assertSame(ProductLayout::Row, $featuredGroup->product_layout);
|
||||||
$this->assertSame(GroupLayout::SimpleVertical, $featuredGroup->group_layout);
|
$this->assertSame(GroupLayout::SimpleVertical, $featuredGroup->group_layout);
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ class ProductCatalogFromImagesSeederTest extends TestCase
|
||||||
->pluck('id');
|
->pluck('id');
|
||||||
|
|
||||||
$this->assertNotNull($paginatedGroup);
|
$this->assertNotNull($paginatedGroup);
|
||||||
|
$this->assertSame('productos', $paginatedGroup->code);
|
||||||
$this->assertSame(ProductLayout::ColumnWithImage, $paginatedGroup->product_layout);
|
$this->assertSame(ProductLayout::ColumnWithImage, $paginatedGroup->product_layout);
|
||||||
$this->assertSame(GroupLayout::Paginated, $paginatedGroup->group_layout);
|
$this->assertSame(GroupLayout::Paginated, $paginatedGroup->group_layout);
|
||||||
$this->assertSame(FeaturedGroupSource::All, $paginatedGroup->source_type);
|
$this->assertSame(FeaturedGroupSource::All, $paginatedGroup->source_type);
|
||||||
|
|
@ -76,6 +77,7 @@ class ProductCatalogFromImagesSeederTest extends TestCase
|
||||||
$this->assertCount(0, $paginatedGroup->featuredItems);
|
$this->assertCount(0, $paginatedGroup->featuredItems);
|
||||||
|
|
||||||
$this->assertNotNull($carouselGroup);
|
$this->assertNotNull($carouselGroup);
|
||||||
|
$this->assertSame('productos-destacados', $carouselGroup->code);
|
||||||
$this->assertSame(ProductLayout::ColumnWithImage, $carouselGroup->product_layout);
|
$this->assertSame(ProductLayout::ColumnWithImage, $carouselGroup->product_layout);
|
||||||
$this->assertSame(GroupLayout::Carousel, $carouselGroup->group_layout);
|
$this->assertSame(GroupLayout::Carousel, $carouselGroup->group_layout);
|
||||||
$this->assertSame(FeaturedGroupSource::Manual, $carouselGroup->source_type);
|
$this->assertSame(FeaturedGroupSource::Manual, $carouselGroup->source_type);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue