Simplify the primary search surface
This commit is contained in:
@@ -149,7 +149,10 @@ test.describe('Unified Search - Live contextual suggestions', () => {
|
||||
await searchInput.focus();
|
||||
await waitForResults(page);
|
||||
|
||||
const suggestionTexts = (await page.locator('.search__suggestions .search__chip').allTextContents())
|
||||
const suggestionChips = page.locator('.search__suggestions .search__chip');
|
||||
await expect(suggestionChips.first()).toBeVisible({ timeout: 10_000 });
|
||||
|
||||
const suggestionTexts = (await suggestionChips.allTextContents())
|
||||
.map((text) => text.trim())
|
||||
.filter((text) => text.length > 0);
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ test.describe('Unified Search - Experience Quality UX', () => {
|
||||
/current-page findings matched first/i,
|
||||
);
|
||||
await expect(page.locator('.search__scope-hint')).toHaveCount(0);
|
||||
await expect(page.locator('[data-overflow-results]')).toContainText(/also relevant elsewhere/i);
|
||||
await expect(page.locator('[data-overflow-results]')).toContainText(/also worth checking/i);
|
||||
await expect(page.locator('[data-overflow-results]')).toContainText(/policy results remain relevant/i);
|
||||
await expect(page.locator('[data-role="domain-filter"]')).toHaveCount(0);
|
||||
await expect(page.locator('app-synthesis-panel')).toHaveCount(0);
|
||||
|
||||
@@ -114,6 +114,40 @@ export async function setupBasicMocks(page: Page) {
|
||||
}
|
||||
return route.fulfill({ status: 400, body: 'blocked' });
|
||||
});
|
||||
|
||||
await page.route('**/api/v1/search/suggestions/evaluate', async (route) => {
|
||||
const body = (route.request().postDataJSON() as { queries?: string[] } | null) ?? {};
|
||||
const queries = body.queries ?? [];
|
||||
return route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
suggestions: queries.map((query) => ({
|
||||
query,
|
||||
viable: true,
|
||||
status: 'grounded',
|
||||
code: 'retrieved_scope_weighted_evidence',
|
||||
cardCount: 1,
|
||||
leadingDomain: 'findings',
|
||||
reason: 'Evidence is available for this suggestion.',
|
||||
})),
|
||||
coverage: {
|
||||
currentScopeDomain: 'findings',
|
||||
currentScopeWeighted: true,
|
||||
domains: [
|
||||
{
|
||||
domain: 'findings',
|
||||
candidateCount: Math.max(1, queries.length),
|
||||
visibleCardCount: Math.max(1, queries.length),
|
||||
topScore: 0.9,
|
||||
isCurrentScope: true,
|
||||
hasVisibleResults: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function setupAuthenticatedSession(page: Page) {
|
||||
|
||||
Reference in New Issue
Block a user