fix: complete InvesteMoz validation and error corrections

This commit is contained in:
2026-10-29 21:47:33 +02:00
parent 63147312e2
commit daf8623441
718 changed files with 127308 additions and 20959 deletions
+4 -4
View File
@@ -108,6 +108,7 @@ class PortalServicesTest extends TestCase
public function test_home_remains_available_when_document_catalogue_schema_is_incompatible(): void
{
DB::swap(\Mockery::mock(DB::getFacadeRoot())->makePartial());
DB::shouldReceive('table')->once()->with('portal_resources as r')
->andThrow(new QueryException('pgsql', 'select missing catalogue columns', [], new \PDOException('SQLSTATE[42703]')));
@@ -164,7 +165,7 @@ class PortalServicesTest extends TestCase
$this->get('/documentos/'.$id.'/download')->assertOk()->assertDownload('exemplo.txt');
$this->get('/documentos/'.$id.'?back=%2Fdocumentos%3Ftopic%3DInvestimento')->assertInertia(fn (Assert $page) => $page
->component('portal/document')->where('resource.title', 'Guia de teste')->where('backUrl', '/documentos?topic=Investimento')
->has('resource.links', 3)->missing('resource.storage_key')->missing('resource.sha256'));
->has('resource.context_actions', 1)->missing('resource.links')->missing('resource.storage_key')->missing('resource.sha256'));
$this->get('/')->assertInertia(fn (Assert $page) => $page->has('essentialResources', 1));
$this->get('/documentos')->assertInertia(fn (Assert $page) => $page->has('resources.data', 1)->where('resources.data.0.title', 'Guia de teste')->missing('resources.data.0.storage_key'));
$this->get('/documentos?q=Guia%20de%20teste&document_type=guide')->assertInertia(fn (Assert $page) => $page
@@ -313,7 +314,7 @@ class PortalServicesTest extends TestCase
{
Storage::fake('local');
$manager = User::factory()->create();
config(['portal.managers' => [$manager->email], 'portal.legacy_content_qa_enabled' => false]);
config(['portal.managers' => [$manager->email], 'portal.legacy_content_enabled' => false, 'portal.legacy_content_qa_enabled' => false]);
$this->actingAs($manager)->post('/management/portal-services/upload', [
'file' => UploadedFile::fake()->createWithContent('original-image-reference.txt', 'Synthetic original without a thematic classification.'),
])->assertSessionHasNoErrors();
@@ -505,8 +506,7 @@ class PortalServicesTest extends TestCase
$this->post('/management/portal-services/resources/'.$id, ['published' => true])->assertSessionHasNoErrors();
$this->getJson('/api/v1/documents/recommendations?module=simulator')->assertOk()
->assertJsonPath('data.0.documentary_evidence.0.key', 'fiscal.iva.lei_22_2022')
->assertJsonPath('data.0.documentary_evidence.0.status', 'citation_checked_application_pending')
->assertJsonMissingPath('data.0.documentary_evidence')->assertJsonCount(1, 'data.0.context_actions')
->assertJsonMissing(['key' => 'fiscal.iva.lei_10_2025']);
}