feat: explore the public opportunity catalogue by corridor
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-23 12:08:33 +02:00
parent 165c2f6171
commit 203492997e
9 changed files with 201 additions and 7 deletions
@@ -0,0 +1,30 @@
<?php
namespace Tests\Feature;
use Illuminate\Support\Facades\DB;
use Inertia\Testing\AssertableInertia as Assert;
use Tests\TestCase;
class OpportunityCorridorExplorerTest extends TestCase
{
public function test_the_public_agribusiness_catalogue_groups_all_34_records_without_page_truncation(): void
{
$target = DB::selectOne('select current_database() as name, inet_server_port() as port');
$this->assertSame('simulator_fiscal_delta_20261021_test', $target->name);
$this->assertSame(55441, (int) $target->port);
$this->withoutVite();
$this->get('/oportunidades?sector=agronegocio&view=corridors')->assertOk()->assertInertia(fn (Assert $page) => $page
->component('investment/catalogue')
->has('corridorGroups', 6)
->where('results.total', 34)
->where('corridorGroups', function ($groups) {
$groups = collect($groups);
$ids = $groups->flatMap(fn ($g) => collect($g['opportunities'])->pluck('id'));
return $ids->count() === 34 && $ids->unique()->count() === 34
&& $groups->pluck('count', 'name')->get('Corredor da Beira') === 7
&& $groups->pluck('count', 'name')->get('Corredor de Maputo') === 5
&& ! str_contains(json_encode($groups), 'source_sha256');
}));
}
}