Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2447-1780452496
Open

fix: resolve 4 cross-package bugs causing test failures#27
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2447-1780452496

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 3, 2026

Summary

Fixes all failing tests (13 tests now pass, 0 type errors) by resolving 4 cross-package bugs:

  • Export rename mismatch: apps/web/src/lib/api.ts imported useThrottle from @e2e/utils but the hook is named useDebounce — fixed import and re-export alias so useSearchDebounce resolves correctly
  • Date formatting: packages/utils/src/format/date.ts used wrong format — fixed to d/MM/yyyy (day without leading zero, month with leading zero)
  • DOM test environment: Added happy-dom environment config in packages/ui/bunfig.toml and root bunfig.toml for UI component tests
  • Stale closure: packages/ui/src/components/DataTable/DataTable.tsx sort handler captured stale state — fixed with functional state update
  • Accessibility: packages/ui/src/components/Button/Button.tsx now forwards aria-label prop for icon-only buttons
  • TypeScript JSX: Fixed tsconfig to support JSX compilation

Verification

bun test → 13 pass, 0 fail, 17 expect() calls
tsc --noEmit → 0 errors

Assumptions

  • Used happy-dom for DOM environment (already available in node_modules)
  • Date format d/MM/yyyy matches test expectations (Australian-style day/month/year)
  • No test files were modified
  • No new dependencies were added

- Fix useSearchDebounce export by correcting import in apps/web/src/lib/api.ts
- Fix date formatting to use d/MM/yyyy (no leading zero on day)
- Add DOM test environment config for packages/ui (happy-dom)
- Fix stale closure in DataTable sort handler using functional state update
- Forward aria-label prop in Button component for accessibility
- Fix tsconfig to include JSX support
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