pesquisa intelignte
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-04 15:52:55 +02:00
parent 6da444ae2e
commit 705dc69d68
4 changed files with 7 additions and 11 deletions
+2 -2
View File
@@ -226,14 +226,14 @@ export default function PortalHero({
</p> </p>
<form <form
action="/oportunidades" action="/pesquisa"
method="get" method="get"
onSubmit={(event) => { onSubmit={(event) => {
event.preventDefault(); event.preventDefault();
const value = new FormData(event.currentTarget).get( const value = new FormData(event.currentTarget).get(
'q', 'q',
); );
router.get('/oportunidades', { router.get('/pesquisa', {
q: q:
typeof value === 'string' typeof value === 'string'
? value.trim() ? value.trim()
-5
View File
@@ -971,11 +971,6 @@ export default function PortalInvestidorApp({
router.get('/oportunidades'); router.get('/oportunidades');
} }
function handleHeroSearch(event: FormEvent<HTMLFormElement>) {
event.preventDefault();
router.get('/oportunidades', { q: heroQuery.trim() });
}
function handleView(opportunity: Opportunity) { function handleView(opportunity: Opportunity) {
router.get('/oportunidades/' + encodeURIComponent(opportunity.slug)); router.get('/oportunidades/' + encodeURIComponent(opportunity.slug));
} }
+1
View File
@@ -115,6 +115,7 @@ Route::get('/artigos/{id}', [EditorialArticleController::class, 'show'])->whereN
Route::get('/carteira', [InvestmentPortfolioController::class, 'index'])->name('portfolio.index'); Route::get('/carteira', [InvestmentPortfolioController::class, 'index'])->name('portfolio.index');
Route::get('/carteira/{id}', [InvestmentPortfolioController::class, 'show'])->whereUuid('id')->name('portfolio.show'); Route::get('/carteira/{id}', [InvestmentPortfolioController::class, 'show'])->whereUuid('id')->name('portfolio.show');
Route::get('/carteira/{id}/interesse', [InvestmentPortfolioController::class, 'resumeInterest'])->whereUuid('id')->middleware(['auth', \App\Http\Middleware\VerifiedOrSimpleParticipation::class])->name('portfolio.interest'); Route::get('/carteira/{id}/interesse', [InvestmentPortfolioController::class, 'resumeInterest'])->whereUuid('id')->middleware(['auth', \App\Http\Middleware\VerifiedOrSimpleParticipation::class])->name('portfolio.interest');
Route::get('/pesquisa', \App\Http\Controllers\GlobalSearchController::class)->name('portal.search');
Route::get('/oportunidades', [InvestmentDiscoveryController::class, 'index'])->name('portal.opportunities'); Route::get('/oportunidades', [InvestmentDiscoveryController::class, 'index'])->name('portal.opportunities');
Route::get('/oportunidades/{slug}', [InvestmentDiscoveryController::class, 'detail'])->name('portal.opportunity'); Route::get('/oportunidades/{slug}', [InvestmentDiscoveryController::class, 'detail'])->name('portal.opportunity');
Route::get('/negocios', [PublicBusinessOpportunityController::class, 'index'])->name('business-marketplace.index'); Route::get('/negocios', [PublicBusinessOpportunityController::class, 'index'])->name('business-marketplace.index');
@@ -55,7 +55,7 @@ await test('the quick search has a native GET destination and submits the actual
const input = nodes(tree).find( const input = nodes(tree).find(
(node) => node.type === 'input' && node.props.name === 'q', (node) => node.type === 'input' && node.props.name === 'q',
); );
assert.equal(form.props.action, '/oportunidades'); assert.equal(form.props.action, '/pesquisa');
assert.equal(form.props.method, 'get'); assert.equal(form.props.method, 'get');
assert.equal(input.props.maxLength, 120); assert.equal(input.props.maxLength, 120);
input.props.onChange({ target: { value: 'plantio de algodao' } }); input.props.onChange({ target: { value: 'plantio de algodao' } });
@@ -80,15 +80,15 @@ await test('the quick search has a native GET destination and submits the actual
}); });
assert.equal(prevented, true); assert.equal(prevented, true);
assert.deepEqual(sent, { assert.deepEqual(sent, {
url: '/oportunidades', url: '/pesquisa',
data: { q: 'plantio de algodao' }, data: { q: 'plantio de algodao' },
}); });
} finally { } finally {
globalThis.FormData = original; globalThis.FormData = original;
} }
const html = renderToStaticMarkup(tree); const html = renderToStaticMarkup(tree);
assert.ok(html.includes('Pesquisa rápida de oportunidades')); assert.ok(html.includes('Pesquisa rápida no InvesteMoz'));
assert.ok(html.includes('action="/oportunidades"')); assert.ok(html.includes('action="/pesquisa"'));
assert.ok(html.includes('Pesquisar')); assert.ok(html.includes('Pesquisar'));
}); });