Improve investor quick search with typed counts, product categories and licensing guidance
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Services\FederatedSearch;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Tests\TestCase;
|
||||
|
||||
final class GlobalSearchTest extends TestCase
|
||||
@@ -35,6 +36,18 @@ final class GlobalSearchTest extends TestCase
|
||||
$this->assertSame('Como investir', $result['data'][0]['title']);
|
||||
}
|
||||
|
||||
public function test_unavailable_public_reference_does_not_hide_other_sources_or_swallow_forbidden_access(): void
|
||||
{
|
||||
$result = app(FederatedSearch::class)->page([
|
||||
'Referências' => fn () => throw new HttpException(503),
|
||||
'Páginas' => fn () => ['count' => 1, 'fetch' => fn () => [['title' => 'Como investir', 'url' => '/como-investir']]],
|
||||
], 1);
|
||||
$this->assertSame(1, $result['total']);
|
||||
$this->assertSame(['Referências'], $result['unavailable']);
|
||||
$this->expectException(HttpException::class);
|
||||
app(FederatedSearch::class)->page(['Restrito' => fn () => throw new HttpException(403)], 1);
|
||||
}
|
||||
|
||||
public function test_public_search_uses_the_existing_portfolio_visibility_scope(): void
|
||||
{
|
||||
if (getenv('GLOBAL_SEARCH_QA') !== '1') {
|
||||
|
||||
Reference in New Issue
Block a user