Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2301-1779438195
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

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

  • Hook rename mismatch: useDebounce in packages/utils was imported as useThrottle/useSearchDebounce in apps/web. Fixed the re-export chain.
  • Button accessibility: The Button component in packages/ui wasn't passing through aria-label, causing icon-only button tests to fail.
  • DataTable stale closure: The sort handler in DataTable captured a stale direction value. Fixed with functional state update (prev => ...).
  • Date format string: formatDate used zero-padded day (dd/MM/yyyy) but tests expected single-digit day (d/MM/yyyy).
  • Test environment: Configured happy-dom for UI package tests via bunfig.toml.

Verification

  • bun test → 13 pass, 0 fail
  • npx tsc --noEmit → only expected bun:test module resolution errors (no real type errors)

Assumptions

  • The bun:test module resolution errors in tsc --noEmit are expected (bun provides these types at runtime, not via tsconfig)
  • No test files were modified
  • No new dependencies were added

- Fix useSearchDebounce/useThrottle export mismatch in apps/web (hook was renamed to useDebounce in packages/utils)
- Fix Button component to pass through aria-label prop for accessibility
- Fix DataTable stale closure bug by using functional state update in sort handler
- Fix date format string to use single-digit day (d/MM/yyyy) matching test expectations
- Configure happy-dom test environment for UI package tests
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