test(tenant): cover split website types and migration
This commit is contained in:
@@ -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>',
|
||||
|
||||
Reference in New Issue
Block a user