feat: Refactor bootstrap functionality by adding AdminApp and Tenant controllers, requests, resources, and services; remove deprecated event form components
This commit is contained in:
40
tests/Unit/Bootstrap/AdminAppBootstrapResourceTest.php
Normal file
40
tests/Unit/Bootstrap/AdminAppBootstrapResourceTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Bootstrap;
|
||||
|
||||
use App\Domains\Bootstrap\Resources\AdminAppBootstrapResource;
|
||||
use App\Domains\Tenant\Models\SocialMedia;
|
||||
use App\Domains\Tenant\Models\WebsiteType;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminAppBootstrapResourceTest extends TestCase
|
||||
{
|
||||
public function test_it_exposes_the_website_type_and_forms(): void
|
||||
{
|
||||
$websiteType = new WebsiteType([
|
||||
'codigo' => 'shopit',
|
||||
'nombre' => 'ShopIt',
|
||||
'dominio' => 'admin.shopit.test',
|
||||
]);
|
||||
$websiteType->setRelation('siteLogo', null);
|
||||
$websiteType->setRelation('footerLogo', null);
|
||||
$socialMedia = new SocialMedia([
|
||||
'code' => 'instagram',
|
||||
'name' => 'Instagram',
|
||||
'icon' => 'fa-brands fa-instagram',
|
||||
]);
|
||||
|
||||
$data = AdminAppBootstrapResource::make([
|
||||
'website_type' => $websiteType,
|
||||
'social_media' => new Collection([$socialMedia]),
|
||||
])->resolve(request());
|
||||
|
||||
$this->assertSame('shopit', $data['website_type_code']);
|
||||
$this->assertSame('event', $data['forms'][0]['code']);
|
||||
$this->assertSame(
|
||||
'instagram',
|
||||
$data['forms'][0]['social_media']->resolve(request())[0]['code']
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user