Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2336-1779468886
Open

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

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes all 9 failing tests across 5 test files in this multi-package TypeScript monorepo.

Changes

  • apps/web/src/lib/api.ts — Fixed renamed hook import: useThrottleuseDebounce, re-exported as useSearchDebounce
  • packages/ui/src/components/Button/Button.tsx — Pass through aria-label prop for icon-only button accessibility
  • packages/ui/src/components/DataTable/DataTable.tsx — Use functional state update to fix stale closure bug in sort handler
  • packages/utils/src/format/date.ts — Use d/MM/yyyy (non-padded day) format instead of dd/MM/yyyy
  • bunfig.toml + packages/ui/bunfig.toml — Configure happy-dom preload for UI component tests

Verification

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

Assumptions

  • The bun:test TypeScript module resolution errors are pre-existing and expected (requires @types/bun which is not in dependencies)
  • happy-dom was already available in node_modules; used its GlobalRegistrator as a preload since bun 1.3.14 ignores [test] environment in bunfig.toml

- Fix renamed hook: re-export useDebounce as useSearchDebounce in api.ts
- Fix Button component: pass through aria-label prop for accessibility
- Fix DataTable: use functional state update to avoid stale closure bug
- Fix date formatting: use d/MM/yyyy (non-padded day) format
- Configure happy-dom preload for UI component 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