Skip to content

fix: resolve all failing tests across monorepo packages#21

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2418-1780075273
Open

fix: resolve all failing tests across monorepo packages#21
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2418-1780075273

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 29, 2026

Summary

  • Renamed hook: Fixed useSearchDebounce export from @e2e/utils — the hook was renamed to useDebounce in packages/utils but consumers still imported the old name. Updated apps/web/src/lib/api.ts to import useDebounce and re-export as useSearchDebounce.
  • Button accessibility: Added aria-label prop passthrough in packages/ui/src/components/Button/Button.tsx so icon-only buttons have accessible names.
  • DataTable stale closure: Fixed sort handler in packages/ui/src/components/DataTable/DataTable.tsx to use functional state update, preventing stale closure on re-renders.
  • Date formatting: Changed format string in packages/utils/src/format/date.ts from dd/MM/yyyy to d/MM/yyyy to produce day without leading zero.
  • DOM test environment: Added happy-dom preload script in bunfig.toml so @testing-library/react tests have a DOM environment.

Verification

All 13 tests pass. No source-code type errors (only expected bun:test module errors in test files).

Assumptions

  • The bun:test TS2307 errors are expected since bun provides the module at runtime but tsc doesn't have type declarations for it — these are test-file-only and don't affect source.
  • The happy-dom preload approach is used because Bun 1.3.14 silently ignores the environment key in bunfig.toml.

- Fix renamed hook: export useSearchDebounce from @e2e/utils via api.ts
- Fix Button accessibility: pass aria-label prop through to button element
- Fix DataTable stale closure: use functional state update in sort handler
- Fix date formatting: use 'd/MM/yyyy' (no leading zero) for day format
- Fix DOM test environment: add happy-dom preload for bun test runner
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