Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2394-1779432775
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all failing tests across the monorepo by resolving 4 cross-package bugs:

  • Renamed hook import (apps/web): The useSearchDebounce export was broken because api.ts imported useThrottle instead of useDebounce from @e2e/utils. Fixed the import and re-export alias.
  • Missing DOM environment (packages/ui): UI component tests failed with "document is not defined". Added happy-dom environment configuration in bunfig.toml with the existing setup file.
  • Missing accessibility attribute (packages/ui): The Button component didn't forward aria-label for icon-only buttons. Added the prop to the interface and element.
  • Stale closure in sort handler (packages/ui): DataTable sort handler captured stale sortDirection state. Fixed by using a functional state update.
  • Date format string (packages/utils): formatDate used zero-padded day (dd/MM/yyyy) but tests expected non-padded (d/MM/yyyy).

Verification

All 13 tests pass, 0 type errors with bun test && npx tsc --noEmit.

Assumptions

  • No test files were modified
  • No new dependencies were added
  • The happy-dom package was already available in node_modules

- Fix renamed hook: re-export useDebounce as useSearchDebounce in api.ts
- Add happy-dom test environment config for UI package
- Forward aria-label prop in Button component for accessibility
- Fix stale closure in DataTable sort handler using functional state update
- Use non-padded day format (d/MM/yyyy) in date formatting utility
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