Skip to content

fix: repair cross-package bugs so all tests and typecheck pass - #84

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2466-1784738196
Open

fix: repair cross-package bugs so all tests and typecheck pass#84
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2466-1784738196

Conversation

@stooit

@stooit stooit commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and eliminates all type errors across the monorepo (packages/ui, packages/utils, apps/web). Result: 13 pass / 0 fail and tsc --noEmit exits clean.

The correct test invocation (per package.json) is:
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts
A bare bun test fails with document is not defined because it skips the happy-dom preload — a runner-invocation artifact, not a source bug.

Bugs fixed

  1. Renamed hook not exported (packages/utils/src/index.ts, apps/web/src/lib/api.ts) — tests and api.ts expected useSearchDebounce from @e2e/utils, but it wasn't exported; api.ts also imported a non-existent useThrottle (TS2305). Reconciled to the correct hook and export name.
  2. Missing accessibility attribute (packages/ui/src/components/Button/Button.tsx) — icon-only buttons now pass aria-label/button props through to the rendered element.
  3. Wrong date format (packages/utils/src/format/date.ts) — now produces en-AU D/MM/YYYY (no leading zero on the day). Uses UTC getters so output is timezone-stable (a naive local-time fix would break on AU-offset machines even though it passes in UTC CI).
  4. bun:test type resolution (tsconfig.json) — added "types": ["bun-types"] so the bun:test import in test files type-checks. Config-only; no test files modified.

DataTable's stale-closure re-render test was verified to pass without changes under the correct preload command.

Assumptions

  • The intended test command is the one defined in package.json (with the happy-dom preload), not a bare bun test.
  • The hook's canonical exported name should be useSearchDebounce (what the tests assert); api.ts was the stale consumer.
  • en-AU D/MM/YYYY (day-before-month, no leading zero on the day) is the expected formatDate output.

Verification

  • bun test ... --preload ./packages/ui/test/setup.ts → 13 pass / 0 fail
  • bunx tsc --noEmit → 0 errors

Constraints honoured

No test files modified, no dependencies added. Changes: 5 files, +9/-14.

- utils: export useSearchDebounce (renamed hook) and reconcile api.ts import
- ui: pass aria-label/props through to icon-only Button element
- utils: format dates as en-AU D/MM/YYYY using timezone-stable UTC getters
- tsconfig: add bun-types so bun:test resolves in test files
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