remove props

This commit is contained in:
2026-06-24 14:43:10 -03:00
parent 8e343ea9c3
commit 75129b7552
41 changed files with 10 additions and 1055 deletions

View File

@@ -1,45 +0,0 @@
<?php
namespace Tests\Feature\Prop;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PropControllerTest extends TestCase
{
use RefreshDatabase;
public function test_it_creates_a_prop_using_enum_data_type(): void
{
$response = $this->postJson('/api/prop-models/tenant/props', [
'codigo' => 'color_primario',
'nombre' => 'Color primario',
'is_required' => false,
'data_type' => 'string',
]);
$response
->assertCreated()
->assertJsonPath('propable_type', 'tenant')
->assertJsonPath('data_type', 'string');
$this->assertDatabaseHas('props', [
'codigo' => 'color_primario',
'data_type' => 'string',
]);
}
public function test_it_rejects_unknown_enum_data_type(): void
{
$response = $this->postJson('/api/prop-models/tenant/props', [
'codigo' => 'color_primario',
'nombre' => 'Color primario',
'is_required' => false,
'data_type' => 'unsupported-type',
]);
$response
->assertUnprocessable()
->assertJsonValidationErrors(['data_type']);
}
}

View File

@@ -10,7 +10,7 @@ class BootstrapTenantControllerTest extends TestCase
{
use RefreshDatabase;
public function test_it_bootstraps_a_tenant_by_domain_and_includes_props(): void
public function test_it_bootstraps_a_tenant_by_domain(): void
{
$tenant = Tenant::create([
'codigo' => 'acme',
@@ -18,22 +18,12 @@ class BootstrapTenantControllerTest extends TestCase
'dominio' => 'acme.com',
]);
Tenant::createProp([
'codigo' => 'primary_color',
'nombre' => 'Primary Color',
'is_required' => false,
'data_type' => 'string',
]);
$tenant->setPropValue('primary_color', 'blue');
$response = $this->getJson('/api/tenants/bootstrap/acme.com');
$response
->assertOk()
->assertJsonPath('codigo', 'acme')
->assertJsonPath('dominio', 'acme.com')
->assertJsonPath('props.primary_color', 'blue');
->assertJsonPath('dominio', 'acme.com');
}
public function test_it_bootstraps_a_tenant_from_a_full_url(): void