feat(tenant): add onticket tenant seeding with branding and assets
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Tests\Feature\Seeders;
|
||||
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Tenant\Models\WebsiteType;
|
||||
use Database\Seeders\SocialMediaSeeder;
|
||||
use Database\Seeders\TenantSeeder;
|
||||
use Database\Seeders\WebsiteTypeSeeder;
|
||||
@@ -14,6 +15,39 @@ class TenantSeederTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_it_creates_the_onticket_tenant_with_website_type_branding(): void
|
||||
{
|
||||
Storage::fake('s3');
|
||||
|
||||
$this->seed([
|
||||
WebsiteTypeSeeder::class,
|
||||
SocialMediaSeeder::class,
|
||||
TenantSeeder::class,
|
||||
]);
|
||||
|
||||
$websiteType = WebsiteType::query()->where('codigo', 'onticket')->sole();
|
||||
$tenant = Tenant::query()->where('codigo', 'onticket')->sole();
|
||||
|
||||
$this->assertSame('onticket', $tenant->client->code);
|
||||
$this->assertSame($websiteType->codigo, $tenant->website_type_code);
|
||||
$this->assertSame($websiteType->nombre, $tenant->nombre);
|
||||
$this->assertSame($websiteType->dominio, $tenant->dominio);
|
||||
$this->assertSame($websiteType->site_title, $tenant->site_title);
|
||||
|
||||
foreach (['primary_color', 'secondary_color', 'danger_color', 'success_color'] as $color) {
|
||||
$this->assertSame($websiteType->{$color}, $tenant->{$color});
|
||||
}
|
||||
|
||||
$this->assertSame('onticket_logo.png', $tenant->headerLogo->filename);
|
||||
$this->assertSame('onticket_footer_logo.png', $tenant->footerLogo->filename);
|
||||
$this->assertSame('onticket_favicon.svg', $tenant->favicon->filename);
|
||||
$this->assertSame('onticket_header_background.png', $tenant->headerBackgroundImage->filename);
|
||||
|
||||
foreach ([$tenant->headerLogo, $tenant->footerLogo, $tenant->favicon, $tenant->headerBackgroundImage] as $attachment) {
|
||||
Storage::disk('s3')->assertExists($attachment->path);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_it_assigns_social_media_to_both_tenants_in_order(): void
|
||||
{
|
||||
Storage::fake('s3');
|
||||
|
||||
Reference in New Issue
Block a user