Skip to content

fix: resolve failing tests and type errors across monorepo#56

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-5217-1782406481
Open

fix: resolve failing tests and type errors across monorepo#56
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-5217-1782406481

Conversation

@stooit

@stooit stooit commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests and the 1 outstanding tsc --noEmit error across the monorepo. The bugs spanned package boundaries (packages/utilsapps/web) as well as in-component logic and accessibility/formatting concerns.

Final state: bun run test → 13/13 pass · npx tsc --noEmit → 0 errors.

Fixes

File Bug Fix
apps/web/src/lib/api.ts Imported useThrottle, which @e2e/utils no longer exports (hook was renamed to useDebounce) — caused TS2305 + 2 failing api module tests Import useDebounce and re-export it as useSearchDebounce
packages/utils/src/format/date.ts Produced zero-padded day-first (01/03/2024); test expects non-padded en-AU style (1/03/2024) Switched to en-AU short date formatting (day-first, non-padded day)
packages/ui/src/components/Button/Button.tsx Icon-only button had no accessible name — aria-label not wired through Wire aria-label so icon-only buttons expose an accessible name
packages/ui/src/components/DataTable/DataTable.tsx Stale-closure bug caught by a controlled re-render test Use a functional state updater so the latest state is read on toggle
tsconfig.json tsc could not resolve the bun:test module in test files Added bun-types to compiler types (resolution only — no loosening of strictness)

Constraints honoured

  • ✅ No test files modified
  • ✅ No new dependencies added
  • ✅ Only source required by the tests was changed
  • ✅ Fixes are general (not hard-coded to the test inputs)

Verification

  • Independently re-ran bun run test (13/13 pass, exit 0) and npx tsc --noEmit (0 errors, exit 0) after the changes.
  • Diff reviewed by the review subagent: no blockers; the tsconfig.json change confirmed to be a minimal resolution fix that does not weaken type safety.

Assumptions

  • The renamed hook is useDebounce (inferred from the utils export surface and the useSearchDebounce re-export the test asserts).
  • The expected date format is en-AU day-first with a non-padded day, per the formatDate test expecting /^1/ for 1 March 2024.

- api.ts: use renamed useDebounce hook (was useThrottle) from @e2e/utils
- date.ts: use en-AU short dateStyle for day-first, non-padded formatting
- Button.tsx: always wire aria-label so icon-only buttons are accessible
- DataTable.tsx: fix stale-closure sort toggle via functional state updater
- tsconfig.json: add bun-types so tsc resolves bun:test globals
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