fix: keep opportunity preparation focused on the pending selection
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-23 12:29:26 +02:00
parent f1ac82ae4d
commit 7226287526
5 changed files with 47 additions and 55 deletions
@@ -33,6 +33,20 @@ final class InvestmentOpportunityChoicesTest extends TestCase
return $this->postJson('/investimentos', ['title' => 'QA: investimento conjunto', 'client_key' => (string) Str::uuid(), 'reuse_consent' => true])->assertCreated()->json('id');
}
public function test_edit_recovers_requested_opportunity_without_presenting_it_as_already_saved(): void
{
$record = Opportunity::where('management_creation_key', app(CorridorAgribusinessOpportunities::class)->entries()[0]['key'])->firstOrFail();
$id = $this->dossier();
$before = $this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->json('context');
$this->get('/investimentos/'.$id.'/contexto/editar?source=opportunity:'.$record->id)->assertOk()
->assertInertia(fn (\Inertia\Testing\AssertableInertia $page) => $page->component('investor-path/context')
->where('source.key', 'opportunity:'.$record->id)
->where('requestedChoices.0.opportunity.key', 'opportunity:'.$record->id)
->where('requestedChoices.0.opportunity.title', $record->title));
$after = $this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->json('context');
$this->assertSame($before, $after);
}
public function test_multiple_opportunities_keep_sites_sources_requirements_and_results_in_one_dossier(): void
{
$entries = array_slice(app(CorridorAgribusinessOpportunities::class)->entries(), 0, 2);