Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2392-1780337561
Open

fix: resolve 4 cross-package bugs causing test failures#25
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2392-1780337561

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 1, 2026

Summary

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

  • Hook rename mismatch (apps/web/src/lib/api.ts): Updated import from useThrottle to useDebounce and re-exported as useSearchDebounce to match the expected API
  • Date formatting (packages/utils/src/format/date.ts): Changed day format from zero-padded dd to non-padded d so output is 1/03/2024 not 01/03/2024
  • Button accessibility (packages/ui/src/components/Button/Button.tsx): Passed ariaLabel prop through as aria-label HTML attribute for icon-only buttons
  • DataTable stale closure (packages/ui/src/components/DataTable/DataTable.tsx): Used functional state update in sort handler to avoid capturing stale state
  • Test environment (bunfig.toml): Added happy-dom preload to root bunfig.toml so UI tests run with a DOM environment when bun test is invoked from the repo root

Verification

All 13 tests pass, 0 failures. TypeScript type-check clean (only expected bun:test module resolution warnings).

Assumptions

  • The bun:test module resolution errors in tsc --noEmit are expected and acceptable (bun:test is a runtime-only module)
  • No test files were modified
  • No new dependencies were added

- Fix renamed hook import: useThrottle → useDebounce in apps/web/src/lib/api.ts
- Fix date format: use non-padded day (d/MM/yyyy) in packages/utils/src/format/date.ts
- Fix Button accessibility: pass ariaLabel prop as aria-label attribute
- Fix DataTable stale closure: use functional state update in sort handler
- Fix test environment: add happy-dom preload to root bunfig.toml for UI 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