Skip to content

fix: repair cross-package bugs causing test and type failures#46

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2365-1781683759
Open

fix: repair cross-package bugs causing test and type failures#46
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2365-1781683759

Conversation

@stooit

@stooit stooit commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo. The failures spanned three packages and a shared tsconfig. All 13 tests pass and bunx tsc --noEmit is clean.

Changes

  • packages/utils — A hook was renamed useThrottleuseDebounce but consumers still imported the old name. Added a re-export alias useDebounce as useSearchDebounce from the package barrel so @e2e/utils exposes the name the test expects, without duplicating the implementation.
  • apps/web/src/lib/api.ts — Updated to import/re-export useSearchDebounce (was importing the removed useThrottle), fixing both the runtime test and the tsc error.
  • packages/utils/src/format/date.tsformatDate produced zero-padded / wrong-order output. Switched to a locale-correct day-first short format so dates like 1 March render 1/03/... rather than month-first or zero-padded.
  • packages/ui/Button — Icon-only buttons weren't forwarding aria-label to the DOM. Now forwards an explicitly supplied aria-label, and applies a sensible default for icon-only buttons when none is given (accessibility requirement from the test).
  • tsconfig.json + bun-env.d.ts — Test files use bun:test, which tsc couldn't resolve. Fixed via an ambient /// <reference types="bun-types" /> file rather than a types array, to avoid disabling automatic @types/* discovery (which could break a real Next.js build).

Verification

  • bun run test13 pass / 0 fail
  • bunx tsc --noEmit0 errors

Assumptions

  • DataTable's controlled re-render test already passed; left untouched (no stale-closure bug present).
  • No test files modified; no dependencies added — fixes are limited to what the tests require.
  • Icon-only default aria-label chosen to satisfy the "non-null accessible name" assertion when no label is passed.

- utils: re-export renamed useDebounce hook as useSearchDebounce alias;
  update apps/web api.ts to consume it (removes stale useThrottle import)
- utils: fix formatDate to day-first locale-correct output (en-AU short)
- ui: forward aria-label on Button, with sensible default for icon-only
- tsconfig: resolve bun:test types via ambient bun-env.d.ts reference
  (avoids narrowing global @types discovery)
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