test(tenant): cover split website types and migration

This commit is contained in:
2026-09-17 14:25:54 -03:00
parent 6bc784519f
commit 486129a92f
36 changed files with 335 additions and 307 deletions

View File

@@ -25,7 +25,8 @@ class StoreTenantWithExtrasTest extends TestCase
public function test_it_creates_a_tenant_and_validates_and_stores_its_website_extras(): void
{
$response = $this->postJson('/api/tenants', array_merge($this->tenantData(), [
'website_type_code' => 'onticket',
'admin_website_type_code' => 'shopit',
'storefront_website_type_code' => 'onticket',
'extras' => [
'eventConfig' => [
'title' => 'Festival',
@@ -49,7 +50,8 @@ class StoreTenantWithExtrasTest extends TestCase
$response
->assertCreated()
->assertJsonPath('data.website_type_code', 'onticket')
->assertJsonPath('data.admin_website_type_code', 'shopit')
->assertJsonPath('data.storefront_website_type_code', 'onticket')
->assertJsonMissingPath('data.website_type')
->assertJsonPath('data.extras.eventConfig.title', 'Festival');
@@ -83,7 +85,7 @@ class StoreTenantWithExtrasTest extends TestCase
public function test_it_rejects_an_extra_not_supported_by_the_selected_website_type(): void
{
$this->postJson('/api/tenants', array_merge($this->tenantData(), [
'website_type_code' => 'shopit',
'storefront_website_type_code' => 'shopit',
'extras' => [
'eventConfig' => [
'title' => 'Not supported',
@@ -99,7 +101,7 @@ class StoreTenantWithExtrasTest extends TestCase
public function test_it_applies_the_extra_schema_rules(): void
{
$this->postJson('/api/tenants', array_merge($this->tenantData(), [
'website_type_code' => 'onticket',
'storefront_website_type_code' => 'onticket',
'extras' => [
'eventConfig' => [
'dates' => [[
@@ -121,7 +123,7 @@ class StoreTenantWithExtrasTest extends TestCase
$image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==';
$response = $this->postJson('/api/tenants', array_merge($this->tenantData(), [
'website_type_code' => 'shopit',
'storefront_website_type_code' => 'shopit',
'extras' => [
'carousel' => [$image],
],
@@ -162,7 +164,7 @@ class StoreTenantWithExtrasTest extends TestCase
$image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==';
$response = $this->postJson('/api/tenants', array_merge($this->tenantData(), [
'website_type_code' => 'onticket',
'storefront_website_type_code' => 'onticket',
'extras' => [
'heroConfig' => [
'title_html' => '<h1>Festival</h1>',