feat(website-type): add 'dominio' field to WebsiteType model and update related tests
This commit is contained in:
parent
893bea1492
commit
6858b387c3
|
|
@ -12,6 +12,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||
#[Fillable([
|
||||
'codigo',
|
||||
'nombre',
|
||||
'dominio',
|
||||
'primary_color',
|
||||
'secondary_color',
|
||||
'danger_color',
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ return new class extends Migration
|
|||
public function up(): void
|
||||
{
|
||||
Schema::table('website_type', function (Blueprint $table): void {
|
||||
$table->string('primary_color')->nullable()->after('nombre');
|
||||
$table->string('dominio')->nullable()->unique()->after('nombre');
|
||||
$table->string('primary_color')->nullable()->after('dominio');
|
||||
$table->string('secondary_color')->nullable()->after('primary_color');
|
||||
$table->string('danger_color')->nullable()->after('secondary_color');
|
||||
$table->string('success_color')->nullable()->after('danger_color');
|
||||
|
|
@ -31,6 +32,7 @@ return new class extends Migration
|
|||
}
|
||||
|
||||
$table->dropColumn([
|
||||
'dominio',
|
||||
'primary_color',
|
||||
'secondary_color',
|
||||
'danger_color',
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class WebsiteExtrasTest extends TestCase
|
|||
'id',
|
||||
'codigo',
|
||||
'nombre',
|
||||
'dominio',
|
||||
'primary_color',
|
||||
'secondary_color',
|
||||
'danger_color',
|
||||
|
|
@ -67,6 +68,7 @@ class WebsiteExtrasTest extends TestCase
|
|||
$type = WebsiteType::query()->create([
|
||||
'codigo' => 'store',
|
||||
'nombre' => 'Tienda',
|
||||
'dominio' => 'store.test',
|
||||
'primary_color' => '#111111',
|
||||
'secondary_color' => '#222222',
|
||||
'danger_color' => '#ff0000',
|
||||
|
|
@ -93,6 +95,7 @@ class WebsiteExtrasTest extends TestCase
|
|||
]);
|
||||
|
||||
$this->assertTrue($type->extras()->firstOrFail()->is($typeExtra));
|
||||
$this->assertSame('store.test', $type->dominio);
|
||||
$this->assertSame('#111111', $type->primary_color);
|
||||
$this->assertSame('#222222', $type->secondary_color);
|
||||
$this->assertSame('#ff0000', $type->danger_color);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class WebsiteTypeServiceTest extends TestCase
|
|||
$websiteType = app(WebsiteTypeService::class)->create([
|
||||
'codigo' => 'marketplace',
|
||||
'nombre' => 'Marketplace',
|
||||
'dominio' => 'marketplace.test',
|
||||
'primary_color' => '#111111',
|
||||
'secondary_color' => '#222222',
|
||||
'danger_color' => '#ff0000',
|
||||
|
|
@ -35,6 +36,7 @@ class WebsiteTypeServiceTest extends TestCase
|
|||
Storage::disk('s3')->assertExists($siteLogo->path);
|
||||
$this->assertDatabaseHas('website_type', [
|
||||
'codigo' => 'marketplace',
|
||||
'dominio' => 'marketplace.test',
|
||||
'login_header_footer_color' => '#333333',
|
||||
'site_logo' => $siteLogo->id,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue