Skip to content

fix: resolve cross-package test failures in monorepo#26

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2426-1780422270
Open

fix: resolve cross-package test failures in monorepo#26
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2426-1780422270

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented Jun 2, 2026

Summary

  • Renamed hook import: useThrottle was renamed to useDebounce in packages/utils but apps/web/src/lib/api.ts still imported the old name. Fixed the import and re-export alias.
  • Date formatting: formatDate in packages/utils was zero-padding the day (01/03/2024). Fixed to use d/MM/yyyy format for Australian locale (e.g., 1/03/2024).
  • DOM test environment: UI component tests failed with "document is not defined". Added happy-dom environment configuration to bunfig.toml for packages/ui.
  • Button accessibility: Icon-only Button component was not forwarding aria-label to the rendered <button> element. Fixed by spreading all remaining props.
  • DataTable stale closure: Sort handler captured stale state in a closure. Fixed by using functional setState(prev => ...) pattern.

Verification

All 13 tests pass (bun test). TypeScript check (npx tsc --noEmit) shows only expected bun:test module resolution warnings from test files.

Assumptions

  • The bun:test TypeScript errors are pre-existing and not in scope (they're a known bun limitation with type declarations)
  • 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 formatting: use day-first without zero-padding (d/MM/yyyy) in packages/utils
- Configure happy-dom test environment for UI component tests
- Add aria-label pass-through to Button component for accessibility
- Fix stale closure bug in DataTable sort handler using functional setState
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