fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
@@ -25,13 +26,17 @@ final class IvaAcquisitionRightDraftTest extends TestCase
|
||||
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$book = $store['books']['opportunity:368'];
|
||||
$this->assertCount(5, $book['rows']);
|
||||
$this->assertSame(['eligible','eligible','eligible','no_right','no_right'], array_column(array_column($book['result']['rows'], 'eligibility'), 'status'));
|
||||
$this->assertSame(['eligible', 'eligible', 'eligible', 'no_right', 'no_right'], array_column(array_column($book['result']['rows'], 'eligibility'), 'status'));
|
||||
$this->assertSame('48.00', $book['result']['periods'][0]['fields']['15']);
|
||||
$this->assertCount(1, $book['history']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-l2a-preserved.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
foreach (json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR) as $key => $map) {
|
||||
if ($key === 'version') continue;
|
||||
foreach ($map as $context => $original) $this->assertSame($original, $store[$key][$context]);
|
||||
if ($key === 'version') {
|
||||
continue;
|
||||
}
|
||||
foreach ($map as $context => $original) {
|
||||
$this->assertSame($original, $store[$key][$context]);
|
||||
}
|
||||
}
|
||||
file_put_contents(base_path('outputs/iva-l2-a-20261025/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user