novas funcionalidades dos formulario
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-02 11:13:37 +02:00
parent a6afb4e97a
commit 4f35313d06
104 changed files with 7653 additions and 178 deletions
+14
View File
@@ -32,6 +32,9 @@ class InterestSubmissionTest extends TestCase
$this->assertDatabaseCount('interest_requests', 1);
$this->assertDatabaseCount('interest_submission_receipts', 1);
$this->assertDatabaseCount('outbox_events', 1);
$this->assertDatabaseCount('consents', 1);
$this->assertDatabaseHas('consents', ['interest_request_id' => InterestRequest::firstOrFail()->id,
'purpose' => 'respond_to_interest', 'status' => 'granted', 'policy_version' => '2026-09-30']);
$this->assertDatabaseCount('jobs', 1);
$event = DB::table('outbox_events')->first();
$this->assertSame('pending', $event->status);
@@ -51,6 +54,17 @@ class InterestSubmissionTest extends TestCase
$this->assertDatabaseCount('outbox_events', 1);
}
public function test_proponent_sharing_is_a_separate_optional_versioned_consent(): void
{
$this->postJson('/api/v1/interest-requests', [...$this->payload(), 'shareWithProponent' => true])->assertCreated();
$interest = InterestRequest::firstOrFail();
$this->assertDatabaseHas('consents', ['interest_request_id' => $interest->id,
'purpose' => 'respond_to_interest', 'status' => 'granted']);
$this->assertDatabaseHas('consents', ['interest_request_id' => $interest->id,
'purpose' => 'share_contact_with_proponent', 'status' => 'granted', 'policy_version' => '2026-09-30']);
$this->assertSame(2, DB::table('consents')->where('interest_request_id', $interest->id)->count());
}
public function test_old_clients_still_work_and_distinct_keys_create_distinct_submissions(): void
{
$this->postJson('/api/v1/interest-requests', $this->payload())->assertCreated();