Skip to content

fix: repair cross-package bugs failing the test suite - #125

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2215-1787012451
Open

fix: repair cross-package bugs failing the test suite#125
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2215-1787012451

Conversation

@stooit

@stooit stooit commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors in the monorepo. Baseline was 5 failing tests + 1 tsc error spanning three packages; now 13/13 tests pass and tsc --noEmit is clean.

Changes

  • apps/web/src/lib/api.ts — the utility hook was renamed to useDebounce in packages/utils, but apps/web still imported the removed useThrottle. Updated the import and re-exported it as useSearchDebounce (the consumer-facing name the test asserts). packages/utils was already exporting the renamed hook, so no util change was needed and no other consumer breaks.
  • packages/ui/.../Button/Button.tsx — icon-only buttons never applied an aria-label (a comment sat where the attribute belonged), failing WCAG 2.2 SC 4.1.2. Now applies the explicit label, falls back to string children then a default, and warns in dev when unlabelled.
  • packages/utils/src/format/date.ts — dates were zero-padding the day (01/03/2024). The test requires day-first, non-padded (1/03/2024). Switched to en-GB with day: "numeric", which honours the non-padded day while keeping a 4-digit year (the in-file comment's suggested dateStyle: 'short' fix would have regressed the year to 2 digits).
  • tsconfig.json — added "types": ["bun-types"] to resolve pre-existing Cannot find module 'bun:test' errors. bun-types was already a devDependency — no new dependency added.

Verification

bun run test  -> 13 pass, 0 fail
tsc --noEmit  -> exit 0

Notes / assumptions

  • DataTable "stale closure" test: was passing at baseline and left unchanged, per the "fix only what the tests require" constraint. handleSort is re-created each render and closes over the current sortDir, so double-click correctly reaches desc despite the BUG: comment.
  • No test files were modified. No dependencies were added.
  • The direct-bun test document is not defined errors were a false signal — the real entrypoint is the test npm script, which preloads packages/ui/test/setup.ts for the DOM.

- web: reconcile renamed hook — import useDebounce and re-export as
  useSearchDebounce (was importing the removed useThrottle)
- ui: apply aria-label on icon-only Button for WCAG 2.2 SC 4.1.2
- utils: format dates day-first without zero-padding (en-GB, day numeric)
- tsconfig: add bun-types so tsc resolves bun:test (pre-existing devDep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant