Skip to content

fix: repair cross-package bugs and align test/type config - #182

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2176-1790007594
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2176-1790007594

Conversation

@stooit

@stooit stooit commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests (was 4 pass / 9 fail → now 13 pass / 0 fail) and all type errors (was 5 → now 0) across the monorepo. Verified with bun test && tsc --noEmit from the repo root.

Bugs spanned all three packages plus a root test/type config gap that made a bare bun test (as opposed to the npm test script) fail to register the DOM environment.

Fixes

  • apps/web/src/lib/api.ts — the useThrottle hook was renamed in packages/utils; aligned the consumer to the current useDebounce export (TS2305). Consumer updated, hook not renamed back.
  • packages/ui/.../Button.tsx — icon-only buttons now receive an accessible name via aria-label, with a dev-mode console.warn when omitted (WCAG 2.2 SC 4.1.2).
  • packages/ui/.../DataTable.tsx — fixed a stale-closure bug in the sort handler (functional setSortDir updater) so a second click sorts descending.
  • packages/utils/.../date.ts — produce a day-first, non-zero-padded day (e.g. 1/03/2024) via formatToParts, so day 1 isn't confused with month 1.
  • bunfig.toml — added preload of the happy-dom setup so a bare bun test from root defines document.
  • tsconfig.json — added bun-types (already installed) to resolve bun:test (TS2307).

Constraints honoured

  • No test files or setup.ts modified.
  • No new dependencies added (bun-types was already in node_modules).

Assumptions / notes worth review

  • date.ts: kept en-AU and controlled zero-padding explicitly rather than switching to en-NZ (which happens to emit the exact string via an ICU quirk) — more stable across ICU updates.
  • Button: the accessibility test asserts aria-label is non-null even when no label is passed, forcing a fallback string. That's a correctness floor, not a meaningful accessible name — the dev warning surfaces the real omission at the call site.

An accessibility-focused review pass would be a reasonable follow-up.

- api.ts: import current useDebounce export (was stale useThrottle)
- Button: apply aria-label with icon-only fallback + dev warning (WCAG 4.1.2)
- DataTable: fix stale-closure sort via functional state updater
- date.ts: day-first, non-zero-padded day via formatToParts
- bunfig.toml: preload happy-dom setup for bare 'bun test' from root
- tsconfig.json: add bun-types to resolve bun:test
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