feat: demonstrar percurso IVA QA e consolidar revisao

This commit is contained in:
2026-10-21 09:40:49 +02:00
parent 83d2f97d82
commit d186f94206
8 changed files with 505 additions and 1 deletions
@@ -147,4 +147,15 @@ class SimulationFiscalQaPreviewTest extends TestCase
$rule->update(['rule_definition' => $definition]);
$this->preview()->assertUnprocessable()->assertJsonPath('message', 'Este percurso preserva o valor exacto e não aplica arredondamento automático.');
}
public function test_qa_review_page_uses_existing_administration_and_environment_guards(): void
{
$path = '/management/investment/tax-rules/'.$this->ruleId.'/qa-review';
$this->get($path)->assertRedirect('/login');
$this->actingAs($this->editor)->get($path)->assertOk()->assertInertia(fn ($page) => $page
->component('management/fiscal-qa-review')->where('rule.id', $this->ruleId)->where('rule.code', 'IVA-GERAL-BASE-LIQUIDA'));
$this->actingAs(User::factory()->withTwoFactor()->create())->get($path)->assertForbidden();
config(['database.connections.pgsql.url' => 'not-an-isolated-qa-target']);
$this->actingAs($this->editor)->get($path)->assertNotFound();
}
}