Skip to content

fix: repair cross-package bugs and test DOM/type setup#71

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2475-1783702080
Open

fix: repair cross-package bugs and test DOM/type setup#71
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2475-1783702080

Conversation

@stooit

@stooit stooit commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing bun test cases and tsc --noEmit errors across the monorepo. Bugs spanned three packages plus the shared test/type configuration. All 13 tests now pass and tsc --noEmit is clean.

Changes

Package File Fix
apps/web src/lib/api.ts useThrottle was renamed to useDebounce in packages/utils; updated the import and the useSearchDebounce re-export to the new name.
packages/ui src/components/Button/Button.tsx Icon-only buttons never applied the destructured ariaLabel. Now wired to the <button> element.
packages/ui src/components/DataTable/DataTable.tsx Stale-closure bug in the sort handler — setSortDir read a captured sortDir. Switched to the functional updater form so a second click sorts descending.
packages/utils src/format/date.ts Short date used US month-first order. Switched to en-AU day/month/year to match the expected format.
root + ui bunfig.toml, packages/ui/bunfig.toml environment = "happy-dom" alone does not inject DOM globals in bun 1.3.14. Added preload of the @happy-dom/global-registrator setup so a bare bun test from the repo root has document/window.
root tsconfig.json Added "types": ["bun-types"] so bun:test globals type-check under tsc --noEmit.

Verification

bun test         # 13 pass, 0 fail across 5 files
npx tsc --noEmit # clean, exit 0

Constraints honored

  • No test files modified.
  • No new dependencies added (happy-dom and bun-types were already installed).
  • Changes are minimal — 7 files, +10/-12 lines — each maps directly to a failing test or type error.

- api.ts: update stale useThrottle import to renamed useDebounce
- Button: apply aria-label so icon-only buttons have an accessible name
- DataTable: use functional setState to fix stale-closure sort direction
- date.ts: use en-AU day/month/year order for short date formatting
- bunfig: wire happy-dom preload so bare 'bun test' has a DOM env
- tsconfig: add bun-types so bun:test globals type-check
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