This commit is contained in:
@@ -195,4 +195,43 @@ class ExistingBusinessIntakeTest extends TestCase
|
||||
$this->assertStringContainsString('Synthetic holder', $snapshot);
|
||||
$this->actingAs(User::factory()->create())->getJson($this->base.'/'.$first)->assertForbidden();
|
||||
}
|
||||
|
||||
public function test_company_sale_real_estate_and_land_right_have_distinct_private_subject_records(): void
|
||||
{
|
||||
$owner = User::factory()->create();
|
||||
$this->actingAs($owner);
|
||||
$cases = [
|
||||
['modality' => 'company_sale', 'kind' => 'company', 'label' => 'Synthetic company sale'],
|
||||
['modality' => 'real_estate', 'kind' => 'property', 'label' => 'Synthetic commercial property'],
|
||||
['modality' => 'land_right', 'kind' => 'land_right', 'label' => 'Synthetic declared land right'],
|
||||
];
|
||||
|
||||
foreach ($cases as $case) {
|
||||
$businessId = $this->postJson($this->base, [
|
||||
'modality' => $case['modality'],
|
||||
'classification' => 'confidential',
|
||||
'reason' => 'Synthetic modality-specific QA draft',
|
||||
'payload' => ['title' => $case['label'], 'wizard_version' => '2', 'wizard_step' => '6'],
|
||||
])->assertCreated()->json('id');
|
||||
|
||||
$this->get('/investidor/negocios/'.$businessId)->assertOk()
|
||||
->assertInertia(fn ($page) => $page->component('investment/business')
|
||||
->where('record.modality', $case['modality'])
|
||||
->has('formSchema')
|
||||
->where('objectKinds', fn ($kinds) => $kinds->contains($case['kind'])));
|
||||
|
||||
$objectId = $this->postJson($this->base.'/'.$businessId.'/objects', [
|
||||
'kind' => $case['kind'],
|
||||
'version_no' => 1,
|
||||
'reason' => 'Synthetic subject record for QA',
|
||||
'payload' => ['label' => $case['label'], 'source_reference' => 'Synthetic source reference'],
|
||||
])->assertCreated()->assertJsonPath('verification_status', 'pending')->json('id');
|
||||
|
||||
$this->getJson($this->base.'/'.$businessId)->assertOk()
|
||||
->assertJsonPath('record.modality', $case['modality'])
|
||||
->assertJsonPath('objects.0.id', $objectId)
|
||||
->assertJsonPath('objects.0.kind', $case['kind'])
|
||||
->assertJsonPath('objects.0.verification_status', 'pending');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user