Skip to content

fix: resolve 4 cross-package test failures in monorepo#55

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-4371-1782234045
Open

fix: resolve 4 cross-package test failures in monorepo#55
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-4371-1782234045

Conversation

@stooit

@stooit stooit commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and source-level type errors across the monorepo. Four bugs spanning packages/utils, packages/ui, and apps/web:

  • Renamed hook (cross-package)useThrottle was renamed to useDebounce in @e2e/utils, but apps/web/src/lib/api.ts still imported the old name (causing TS2305 and the useSearchDebounce export to be missing). Updated the import and re-export; the public useSearchDebounce alias is unchanged.
  • Date locale/formatformatDate forced US-style field order, producing 01/03/2024. Switched to Intl.DateTimeFormat("en-AU", { dateStyle: "short" }) so output is day-first (1/03/2024), matching formatDateTime in the same module.
  • Button accessibility — the aria-label prop was destructured but never forwarded to the <button>. Now forwarded, with an accessible-name fallback for icon-only buttons that have no explicit label (WCAG 4.1.2) so an icon-only button always has a name.
  • DataTable stale closure — the sort-direction toggle read sortDir from a stale closure; switched to the functional setSortDir(prev => ...) updater form.

Verification

  • bun run test -> 13 pass, 0 fail
  • tsc --noEmit -> no source-file type errors

Assumptions / notes

  • The only remaining tsc output is Cannot find module 'bun:test' in four test files. This is pre-existing environment noise (present on the unmodified base commit) and the task forbids modifying test files — left untouched.
  • No test files were modified and no dependencies were added, per the constraints.

- api.ts: reconcile renamed hook useThrottle -> useDebounce across the
  @e2e/utils boundary, keeping the public useSearchDebounce alias
- date.ts: use Intl dateStyle:"short" so en-AU formats day-first (1/03/2024)
- Button.tsx: forward aria-label to the element and provide an accessible
  name fallback for icon-only buttons (WCAG 4.1.2)
- DataTable.tsx: fix stale-closure sort handler via functional setState updater

All 13 tests pass; no new type errors. Test files unchanged.
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