Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2461-1783443340
Open

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

Conversation

@stooit

@stooit stooit commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests (13/13 pass) and eliminates all tsc --noEmit type errors across the monorepo. Four cross-package bugs, all fixed at the root cause. No test files modified, no new dependencies added.

Bugs fixed

  • utils — renamed hook / stale import. useThrottle was renamed to useDebounce, but apps/web/src/lib/api.ts still imported the old name and tests expected useSearchDebounce. packages/utils/src/index.ts now re-exports useDebounce as useSearchDebounce, and api.ts imports a name that exists.
  • ui/Button — missing accessibility attribute. aria-label was not passed through to icon-only buttons. It now reaches the rendered element, with a sensible fallback for icon-only buttons per the test.
  • ui/DataTable — stale closure. The sort toggle captured a stale state value; switched to a functional state updater so the controlled re-render test passes.
  • utils/date — wrong locale/format. formatDate produced a leading-zero, wrong-order date. Now uses a day-first (en-AU) short format so e.g. 1 March 2024 renders as 1/03/2024.

Supporting change

  • tsconfig.json references the already-installed bun-types to resolve the bun:test type-declaration errors. No dependency added.

Verification

  • bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts13 pass, 0 fail
  • npx tsc --noEmit0 errors

Assumptions

  • useSearchDebounce was chosen as the canonical public name because the tests require it; useDebounce remains the underlying implementation with the alias re-exported.
  • For icon-only buttons without an explicit aria-label, a fallback label is applied so the attribute is always present (matching the test's non-null assertion).

- utils: alias useDebounce as useSearchDebounce; reconcile stale useThrottle import in apps/web/src/lib/api.ts
- ui/Button: pass aria-label through to icon-only buttons with a sensible fallback
- ui/DataTable: use functional state updater to fix stale-closure sort toggle
- utils/date: use en-AU dateStyle:short so day is day-first without leading zero
- tsconfig: reference already-installed bun-types to resolve bun:test type errors
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