learning_ai_notes/web
saravanakumardb1 7103660c95 test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof
Audit of the full E2E suite (43 specs) surfaced four issues that were
hiding behind 'all 96/96 web unit tests pass' but actually meant the
browser-level coverage was broken end-to-end. All four are fixed and
the suite now passes 43/43.

1. Port conflict silently testing wrong app. playwright.config.ts hard-
   coded baseURL=http://localhost:3000 with reuseExistingServer:true on
   non-CI hosts. When the dev host had ANY service on :3000 (Grafana,
   chronomind, etc), Playwright happily ran the entire E2E suite
   against the wrong app and reported the unrelated failures as
   'real'. Now honors NOTELETT_WEB_PORT env (default 3000) so a
   contributor can opt into any free port and Playwright drives both
   baseURL and the dev-server PORT consistently.

2. Missing test dependency. web/e2e/accessibility.spec.ts imports
   @axe-core/playwright but web/package.json never declared it.
   The accessibility coverage was DOA — every CI run that included
   this spec would module-not-found-error before a single check ran.
   Added @axe-core/playwright to devDependencies.

3. Mock that never fires. smart-actions.spec.ts 'history API mock
   returns items' used page.route() to mock /api/note-prompts/history
   then bypassed the mock entirely with page.request.get() (which uses
   Playwright's separate request context, not the browser context that
   page.route intercepts). The request went to the dev server and got
   404. Replaced with page.goto + page.evaluate(fetch(...)) so the
   browser-side fetch hits the page.route mock as intended.

4. Missing visual-regression baselines. visual-regression.spec.ts had
   no committed baseline screenshots for dashboard / workspaces /
   search. First run on a clean host always reported 'snapshot doesn't
   exist, writing actual'. Generated and committed darwin baselines.

Verified end-to-end (NOTELETT_WEB_PORT=3050 against this host's free
port):
  43 passed (34.8s)

Total test-tier counts on main now:
  backend unit + integration (memory)   380/380
  backend cosmos emulator (live)        4/4
  web vitest                            96/96
  mobile vitest                         97/97
  web playwright e2e                    43/43
  ---
  TOTAL                                 620/620
2026-05-23 00:50:29 -07:00
..
e2e test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof 2026-05-23 00:50:29 -07:00
public feat: implement WEB_AI_FAST_ROADMAP (web + backend + docs) 2026-03-31 13:00:36 -07:00
scripts chore(web): add bundle analysis gate 2026-05-05 12:45:20 -07:00
src fix(web): resolve the 5 actionable React-compiler lint advisories 2026-05-23 00:20:02 -07:00
test-results chore: update dependencies 2026-03-29 10:50:57 -07:00
.env.example fix(platform): align mcp service urls 2026-05-05 09:19:11 -07:00
.gitignore test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof 2026-05-23 00:50:29 -07:00
Dockerfile fix: Update docker configuration for production deployment 2026-05-12 08:20:12 +00:00
eslint.config.mjs fix(lint): clear production lint blockers 2026-05-05 14:04:49 -07:00
next-env.d.ts test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof 2026-05-23 00:50:29 -07:00
next.config.ts fix(web): prepare Vercel build and standalone runtime 2026-03-31 06:05:16 +00:00
package.json test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof 2026-05-23 00:50:29 -07:00
playwright.config.ts test(e2e): fix 4 pre-existing E2E failures and make port-conflict-proof 2026-05-23 00:50:29 -07:00
tsconfig.json feat(repo): migrate notelett workspace to pnpm 2026-03-22 15:50:54 -07:00
vitest.config.ts fix(web): add Next.js module mocks for Vitest — all 14 tests pass (was 10/14) 2026-03-29 01:03:11 -07:00