Skip to content

fix: resolve cross-package test failures and type errors#61

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2402-1782838273
Open

fix: resolve cross-package test failures and type errors#61
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2402-1782838273

Conversation

@stooit

@stooit stooit commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests and all 5 tsc --noEmit errors in the monorepo. Bugs spanned all three packages. bun run test13 pass / 0 fail; npx tsc --noEmitclean.

Changes

File Fix
apps/web/src/lib/api.ts The useThrottle hook was renamed to useDebounce in @e2e/utils, but the consumer still imported the old name (runtime crash + TS2305). Updated the import and re-exported it as useSearchDebounce to match the consumer test.
packages/utils/src/format/date.ts formatDate produced a zero-padded day (01/03/2024); the test expects no leading zero (1/03/2024). Switched to a locale dateStyle so field order and padding come from the locale.
packages/ui/src/components/Button/Button.tsx aria-label was not forwarded to the underlying <button>. Now destructured and applied explicitly.
packages/ui/src/components/DataTable/DataTable.tsx Stale-closure bug on the sort-direction toggle: replaced the closed-over read with a functional state updater so the latest committed value is always used.
tsconfig.json Added bun-types to compilerOptions.types so bun:test globals resolve (already-installed dep; no new dependency).

Verification

```
$ bun run test → 13 pass / 0 fail
$ npx tsc --noEmit → clean
```

Constraints honoured

  • No test files modified.
  • No new dependencies added (bun-types was already present).
  • Only source + tsconfig touched.

🤖 Generated with QuantCode Agent

- api.ts: import renamed useDebounce hook (was stale useThrottle),
  re-export as useSearchDebounce to match consumer test
- date.ts: use locale dateStyle so day has no leading zero (en-AU/GB order)
- Button.tsx: forward aria-label to the underlying button element
- DataTable.tsx: fix stale closure on sort-direction toggle via functional update
- tsconfig.json: wire up 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