feat(seeder): update image paths in ProductCatalogFromImagesSeeder and TenantSeeder, add new catalog images

This commit is contained in:
2026-07-31 11:45:29 -03:00
parent 3968a10f6a
commit ec1d80dff2
37 changed files with 52 additions and 12 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace Tests\Feature\Tenant;
use App\Domains\Tenant\Services\WebsiteTypeService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class WebsiteTypeServiceTest extends TestCase
{
use RefreshDatabase;
public function test_it_creates_a_website_type_and_uploads_its_logo_to_s3(): void
{
Storage::fake('s3');
$websiteType = app(WebsiteTypeService::class)->create([
'codigo' => 'marketplace',
'nombre' => 'Marketplace',
'primary_color' => '#111111',
'secondary_color' => '#222222',
'danger_color' => '#ff0000',
'success_color' => '#00aa55',
'site_logo' => UploadedFile::fake()->image('site-logo.png'),
]);
$siteLogo = $websiteType->siteLogo()->firstOrFail();
$this->assertSame('marketplace', $websiteType->codigo);
$this->assertSame($siteLogo->id, $websiteType->site_logo);
$this->assertStringStartsWith('website-types/', $siteLogo->path);
Storage::disk('s3')->assertExists($siteLogo->path);
$this->assertDatabaseHas('website_type', [
'codigo' => 'marketplace',
'site_logo' => $siteLogo->id,
]);
}
}