feat(seeder): update image paths in ProductCatalogFromImagesSeeder and TenantSeeder, add new catalog images
This commit is contained in:
40
tests/Feature/Tenant/WebsiteTypeServiceTest.php
Normal file
40
tests/Feature/Tenant/WebsiteTypeServiceTest.php
Normal 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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user