Bugfix: pre-existing web test failures (16 tests / 7 files)
Seen in 1 project by 1 person
About
16 web unit tests fail on develop (apps/web), independent of the subjects/offers/affiliate work — confirmed by stashing all changes and re-running on a clean tree. Repro: cd apps/web && npx vitest run.
Failing files and tests:
-
hooks/tests/useFilters.test.ts (3)
- parseFilters > ignores legacy fields (e.g. showArchived) without crashing
- parseFilters > migrates legacy single tag to tags array
- parseFilters > round-trips a fully populated valid filter object
-
components/projects/tests/NewProjectModal.test.tsx (3)
- POSTs to /api/projects on submit with only name and navigates to the new project
- falls back to UUID when the created project is nested (slug URLs do not resolve for descendants)
- navigates by slug when the created project is top-level and has a slug
-
components/projects/tests/ProjectListClient.test.tsx (2)
- renders a Duplicate button on each sub-project row and opens the modal pre-selected to its current parent
- renders a Duplicate button on each top-level row and opens the modal on click
-
components/options/tests/OptionDefinitionIcon.test.tsx (2)
- still renders a colored chip when slug is general and NO definition is passed
- still renders a colored chip when slug is lodging and NO definition is passed
-
components/options/DayView/tests/InPlaceOptionEditor.test.tsx (2)
- clicking backdrop calls onClose
- portals the modal to document.body so position:fixed escapes ancestor containing blocks
-
components/options/OptionTable/tests/OptionTable.tabs.test.tsx (1)
- collapsible groups > renders the definition as the shared OptionDefinitionIcon chip
-
lib/mcp/tools/tests/list-projects-batched.test.ts (3)
- groups returned descendant rows by their root_id
- issues a constant 2 rpc calls regardless of top-level project count
- returns no descendants property when batch returns no rows
- All three throw
Error: unexpected from(project_tags)from the test's Supabase mock at list-projects-batched.test.ts:90 — listProjects (lib/mcp/tools/projects.ts:359) now queriesproject_tags, which the mock's from() handler doesn't stub. Likely just needs the mock updated to handle the project_tags table.
Note: items 1-6 are component/hook tests (possible jsdom/environment or stale drift); item 7 is a stale test mock after a query change. Check whether any are container/environment-specific before assuming source bugs.
Last claudio run — 2026-05-24
- What changed: Nothing — no code changes were needed. This task was already resolved on
develop. - Why: The task was filed 2026-05-20. The very next day, commit
00706d2("Fix 17 stale web tests + the flaky view-state integration test", 2026-05-21, Claude) landed ondevelopand fixed exactly these failures. Its diff touches all 7 files named here (useFilters, NewProjectModal, ProjectListClient, OptionDefinitionIcon, InPlaceOptionEditor, OptionTable.tabs, list-projects-batched) and its message matches each described failure 1:1 — emoji U+FE0F variation-selector tolerance in the icon/tab matchers, thequickFilterKey: 'state'default in useFilters, the role="dialog" portal + backdrop dismiss for InPlaceOptionEditor, the post-create canonical-path fetch mock with UUID fallback for descendants in NewProjectModal, the bare-source-name DuplicateModal value in ProjectListClient, and the batchedproject_tags/profiles/project_groupsmock reads in list-projects-batched. These were stale tests/mock gaps lagging behind source refactors, not production bugs — source was unchanged. The commit did not reference this task's slug, so the slug/uuid already-shipped grep missed it; confirmed instead by the file-level diff coverage plus a clean test run. - Verification: Created worktree off current
origin/develop(tip 3d35136),pnpm install, thencd apps/web && npx vitest run. The 7 named files: 105 passed, 0 failed. Full web suite: 197 files / 1421 tests, 0 failed (24.5s). All 16 originally-failing tests now pass.git merge-base --is-ancestor 00706d2 origin/develop→ on develop. - Pre-existing issues noticed: None — full web vitest suite is green on develop. (The NewProjectModal
Not implemented: navigationand ProjectListClient shorthand-borderColor lines in stderr are benign jsdom warnings, not failures; those tests pass.) - Disposition: Already shipped — fix is on
developvia 00706d2, fully covered by automated tests that I re-ran green. No new branch/PR/commit. Marked done. Worktree removed. - Next step for reviewer: None required. To re-confirm:
cd apps/web && npx vitest runon develop → expect 0 failures. If you want the failures to reproduce historically, check out 00706d2's parent. - PR: N/A (no changes)
- Branch: N/A (worktree-bugfix-preexisting created for verification, removed; no commits)
- Merge commit (if auto-merged): N/A — fix already on develop as 00706d2
Links
Listed in
Bookmarked in
Not in any public bookmark categories yet.