Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2193-1789402726
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2193-1789402726

Conversation

@stooit

@stooit stooit commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests and all TypeScript errors across the monorepo. bun run test → 13 pass / 0 fail; npx tsc --noEmit → clean (exit 0). No test files or dependencies were modified.

The bugs spanned three packages plus a tsconfig gap:

  • apps/web/src/lib/api.ts — stale import. The hook was renamed to useDebounce in @e2e/utils, but this file still imported useThrottle (TS2305). Fixed the import and kept the public useSearchDebounce alias that apps/web/test/api.test.ts asserts on. Merged the duplicate @e2e/utils import while in there.
  • packages/ui Button — the ariaLabel prop was destructured but never applied to the element. Icon-only buttons now receive an aria-label (WCAG 4.1.2), with a non-production console.warn when one is omitted. Text buttons resolve to undefined, so React omits the attribute and existing behaviour is unchanged.
  • packages/utils formatDate — was producing month-first / mixed-padding output. Now emits a self-consistent day-first AU short date (1/3/2024) with a 4-digit year. formatDateTime left untouched.
  • tsconfig.json — added "types": ["bun-types"] so bun:test resolves during typecheck (removes 4 TS2307 errors). bun-types was already a devDependency — no new dependency added.

Verification

bun run test      ->  13 pass, 0 fail
npx tsc --noEmit  ->  exit 0, clean

Assumptions & notes

  • The "Button" aria-label fallback guarantees a non-empty accessible name to satisfy the test that renders a label-less icon button (Button.test.tsx:28). A discriminated union making the label mandatory would break that unmodifiable test, so a runtime fallback + dev warning is the intended shape. Real call sites should still pass explicit labels.
  • DataTable.tsx carries a BUG: stale closure comment but all its tests pass — handleSort is recreated each render and clicks flush separately, so sortDir is current. Left unchanged as it is not a live defect and no test requires it.
  • The dependabot vulnerability warning on push relates to pre-existing dependencies on the default branch and is out of scope for this test-fix task.

Reviewed for correctness/minimality via the review agent; both the renamed public export and the permissive types array were confirmed to suppress nothing legitimate.

- apps/web/src/lib/api.ts: fix stale import — hook renamed to useDebounce
  in @e2e/utils; keep the public useSearchDebounce alias the test asserts on
- packages/ui Button: apply aria-label to icon-only buttons (WCAG 4.1.2),
  with a dev warning when omitted
- packages/utils formatDate: emit self-consistent day-first AU short date
  (1/3/2024) with 4-digit year, instead of month-first / mixed padding
- tsconfig.json: add bun-types to types so bun:test resolves in typecheck
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