From c083c8c24faedf39c791e07dfb3e7424a7b6e957 Mon Sep 17 00:00:00 2001 From: Erik Hjelm Fjeldheim Date: Tue, 17 Nov 2026 18:28:06 -0600 Subject: [PATCH 1/2] fix: #91 use exact Search button locator and clear E2E history --- e2e/tests/search.spec.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/e2e/tests/search.spec.ts b/e2e/tests/search.spec.ts index e0d37e4..5d74157 100644 --- a/e2e/tests/search.spec.ts +++ b/e2e/tests/search.spec.ts @@ -17,7 +17,8 @@ const E2E_USER_ID = '00000000-0000-4000-8000-000000000e2e'; async function search(page: Page, query: string) { await page.getByRole('combobox', { name: 'Search by album or artist' }).fill(query); - await page.getByRole('button', { name: 'Search' }).click(); + // Exact match avoids matching the "Clear recent searches" button once history opens. + await page.getByRole('button', { name: 'Search', exact: true }).click(); } function resultTitles(page: Page) { @@ -42,10 +43,12 @@ test('search, filter, sort, open an album and keep a review across a reload', as ); // Filter: the decade facet is computed over the whole result set. - await page.getByRole('button', { name: 'Filters' }).click(); + await page.getByRole('button', { name: 'Filters', exact: true }).click(); await page.getByRole('checkbox', { name: /1960s/ }).check(); await expect(page).toHaveURL(/[?&]decades=1960/); - await expect(page.getByRole('button', { name: 'Filters (1)' })).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Filters (1)', exact: true }), + ).toBeVisible(); await page.keyboard.press('Escape'); // Sort: both directions, so the test cannot pass by accident on insertion order. @@ -101,6 +104,13 @@ test('search, filter, sort, open an album and keep a review across a reload', as await expect(page.getByRole('combobox', { name: 'Sort by' })).toHaveValue('TITLE_ASC'); await expect(resultTitles(page)).toHaveText(['Abbey Road', 'Revolver']); + // Clear the fixed user's recorded search so repeated runs start with clean history. + await page.getByRole('combobox', { name: 'Search by album or artist' }).click(); + await page.getByRole('button', { name: 'Clear recent searches', exact: true }).click(); + await expect(page.getByRole('status', { name: 'Search history status' })).toHaveText( + 'Recent searches cleared.', + ); + // Clean up so repeated runs do not pile reviews onto the shared catalog. await page.getByRole('link', { name: 'Abbey Road' }).click(); await page.getByRole('button', { name: 'Delete review' }).click(); From 1f0e44ffc7bcf979b3ba80572b2affcb57859946 Mon Sep 17 00:00:00 2001 From: Erik Hjelm Fjeldheim Date: Tue, 17 Nov 2026 18:29:52 -0600 Subject: [PATCH 2/2] docs: #91 log AI usage for E2E search locator fix --- docs/AI-USAGE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/AI-USAGE.md b/docs/AI-USAGE.md index 8758504..28ed354 100644 --- a/docs/AI-USAGE.md +++ b/docs/AI-USAGE.md @@ -102,6 +102,7 @@ the part that matters most. | 2026-11-12 | rachelks | Codex (ChatGPT) | Assisted with implementing search history (#24), including the GraphQL schema, database migration, backend logic and PostgreSQL tests. The implementation and test results were thoroughly reviewed throughout the process. | | 2026-11-13 | rachelks | Codex (ChatGPT) | Assisted with #24 frontend integration, dropdown keyboard navigation, accessibility and tests, as well as debugging React/Apollo warnings and simplifying the SearchForm/DiscoveryPage responsibilities. All changes were thoroughly reviewed and tested before committing. | | 2026-11-13 | robertky | Codex (ChatGPT) | Assisted me with #26: polished the README, added screenshots and project-document links, and verified the local setup from a clean clone. I reviewed the changes and updated the implementation notes to reflect merged browsing and country-filter features. | +| 2026-11-17 | erikhfj | Antigravity | #91, E2E search helper fix: updated `e2e/tests/search.spec.ts` to match the `Search` and `Filters` buttons with `exact: true` so `Clear recent searches` does not trigger a strict-mode violation, and cleared `E2E_USER_ID`'s recorded search history during cleanup. Verified locally with two consecutive full `pnpm test:e2e` runs against a throwaway seeded PostgreSQL stack. | ## Notes