Skip to content

fix: resolve 4 cross-package bugs causing test failures#5

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2526-1779436219
Open

fix: resolve 4 cross-package bugs causing test failures#5
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2526-1779436219

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all failing tests in this TypeScript monorepo by resolving 4 cross-package bugs:

  • Renamed hook import (apps/web/src/lib/api.ts): Changed useThrottleuseDebounce import from @e2e/utils — the hook was renamed in packages/utils but the consumer still used the old name
  • Stale closure bug (packages/ui/src/components/Button/Button.tsx): Fixed stale closure in click handler caught by controlled re-render test — used callback ref pattern to always read current props
  • Missing accessibility attribute (packages/ui/src/components/DataTable/DataTable.tsx): Added role="table" attribute required by the DataTable test
  • Date formatting locale (packages/utils/src/format/date.ts): Fixed date formatter to use en-AU locale with correct format string

Verification

  • All 13 tests pass (bun test — 0 failures)
  • No real TypeScript errors (npx tsc --noEmit — only expected bun:test module resolution in test files)

Constraints followed

  • No test files modified
  • No new dependencies added
  • Only source code fixes

- Rename useThrottle import to useDebounce in apps/web/src/lib/api.ts (hook was renamed in packages/utils)
- Fix stale closure bug in Button component by using callback ref pattern
- Add role="table" accessibility attribute to DataTable component
- Fix date formatting to use en-AU locale with correct format string
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