commit compras1 2811
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-28 07:11:35 +02:00
parent d58b75c87a
commit eb32c74c56
202 changed files with 17463 additions and 1526 deletions
+12
View File
@@ -48,6 +48,18 @@ test('policy author cannot approve own proposal', function () {
$this->post('/regras-investimento/'.$policy->id.'/decidir', ['decision' => 'approved', 'reason' => 'Teste'])->assertForbidden();
});
test('investment preparation consultation keeps policy and reviews private without publishing or changing them', function () {
$policy = proposeInvestmentTest($this);
$before = InvestmentPolicy::query()->get()->toArray();
$reviews = InvestmentPolicyReview::query()->get()->toArray();
$response = $this->get('/regras-investimento')->assertOk()->assertViewHas('page', fn (array $page) => $page['encryptHistory'] === true && $page['props']['canManage'] === true);
expect($response->headers->get('Cache-Control'))->toContain('private')->toContain('no-store');
$this->actingAs($this->f['issuer'])->get('/regras-investimento')->assertOk()->assertViewHas('page', fn (array $page) => $page['props']['canManage'] === false);
expect(InvestmentPolicy::query()->get()->toArray())->toBe($before)
->and(InvestmentPolicyReview::query()->get()->toArray())->toBe($reviews)
->and($policy->fresh()->status)->toBe('pending');
});
test('policy parameters and decisions cannot be rewritten', function () {
$policy = proposeInvestmentTest($this);
expect(fn () => $policy->update(['ceiling_minor' => 1]))->toThrow(LogicException::class);