feat(tenant): add hero carousel images and update related services and tests
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Tests\Feature\Seeders;
|
||||
|
||||
use App\Domains\Attachable\Models\Attachment;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Tenant\Models\AdminWebsiteType;
|
||||
use Database\Seeders\SocialMediaSeeder;
|
||||
@@ -47,6 +48,29 @@ class TenantSeederTest extends TestCase
|
||||
foreach ([$tenant->headerLogo, $tenant->footerLogo, $tenant->favicon, $tenant->headerBackgroundImage] as $attachment) {
|
||||
Storage::disk('s3')->assertExists($attachment->path);
|
||||
}
|
||||
|
||||
$carousel = $tenant->websiteExtras()
|
||||
->whereHas('websiteTypeExtra', fn ($query) => $query->where('codigo', 'heroCarousel'))
|
||||
->sole();
|
||||
$imageIds = $carousel->config;
|
||||
$this->assertCount(8, $imageIds);
|
||||
$this->assertSame([
|
||||
'onticket_hero_carousel_1.png',
|
||||
'onticket_hero_carousel_2.png',
|
||||
'onticket_hero_carousel_3.avif',
|
||||
'onticket_hero_carousel_4.jfif',
|
||||
'onticket_hero_carousel_5.jfif',
|
||||
'onticket_hero_carousel_6.jfif',
|
||||
'onticket_hero_carousel_7.avif',
|
||||
'onticket_hero_carousel_8.avif',
|
||||
], array_map(fn (int $id): string => Attachment::query()->findOrFail($id)->filename, $imageIds));
|
||||
|
||||
foreach ($imageIds as $id) {
|
||||
Storage::disk('s3')->assertExists(Attachment::query()->findOrFail($id)->path);
|
||||
}
|
||||
|
||||
$this->seed(TenantSeeder::class);
|
||||
$this->assertSame($imageIds, $carousel->fresh()->config);
|
||||
}
|
||||
|
||||
public function test_it_assigns_social_media_to_both_tenants_in_order(): void
|
||||
|
||||
Reference in New Issue
Block a user