Skip to content

fix: resolve cross-package bugs causing test failures#9

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2366-1779438527
Open

fix: resolve cross-package bugs causing test failures#9
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier3-2366-1779438527

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

Fixes 4 cross-package bugs that caused 9 test failures across the monorepo:

  • Renamed hook importapps/web/src/lib/api.ts imported useThrottle which was renamed to useDebounce in @e2e/utils; also added useSearchDebounce re-export that tests expect
  • DOM environment for UI tests — Added jsdom test environment in bunfig.toml so @testing-library/react tests have a DOM
  • Accessibility attribute — Forwarded aria-label prop in Button component for icon-only button accessibility
  • Stale closure in DataTable — Used functional state update in sort handler to avoid stale closure on re-renders
  • Date format string — Changed format from dd/MM/yyyy to d/MM/yyyy (day without leading zero)

Verification

All 13 tests pass, 0 failures. TypeScript source files compile cleanly (npx tsc --noEmit only reports missing bun:test type declarations in test files, which is expected).

Assumptions

  • The bun:test module type declaration errors in test files are pre-existing and not in scope (we cannot modify test files or add dependencies)
  • The useSearchDebounce export is a thin wrapper re-exporting useDebounce under the name the consuming app expects

- Rename useThrottle import to useDebounce in apps/web/src/lib/api.ts and
  add useSearchDebounce re-export from @e2e/utils
- Add jsdom test environment config in bunfig.toml for UI package tests
- Forward aria-label prop in Button component for accessibility
- Fix stale closure in DataTable sort handler using functional state update
- Correct date format string to use day without leading zero (d/MM/yyyy)
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