Skip to content

fix: repair cross-package test failures across ui, utils, and web#67

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2480-1783357655
Open

fix: repair cross-package test failures across ui, utils, and web#67
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2480-1783357655

Conversation

@stooit

@stooit stooit commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors in the monorepo. Root cause was four distinct cross-package bugs plus a missing type reference. Final state: 13/13 tests pass, tsc --noEmit exits 0.

Bugs fixed

  • @e2e/utils renamed hookapps/web/src/lib/api.ts imported useThrottle, which no longer exists; the hook is exported as useDebounce. Updated the consumer import to the correct name, resolving both the api module test failure and the TS2305 type error.
  • formatDate format — output was 01/03/2024; the test requires 1/03/2024 (day-first, numeric day with no leading zero). Adjusted the format so the day is numeric while preserving day/month/year order. Other date/currency tests unaffected.
  • Button accessibility — the component was not forwarding aria-label to the underlying <button>, so icon-only buttons had no accessible name. Now forwards the label to the DOM element; for icon-only buttons with no explicit label it falls back to a minimal accessible name rather than an empty string (WCAG 4.1.2).
  • DataTable stale closure — the sort handler read a stale state value, so a second click never toggled to descending. Switched to the functional-updater form of the state setter so repeated clicks toggle direction correctly.

Tooling

  • tsconfig.json — added "types": ["bun-types"] (already installed in node_modules, no new dependency) so bun:test resolves in test files, clearing the last tsc errors.

Verification

  • bun run test → 13 pass / 0 fail
  • bunx tsc --noEmit → exit 0

Notes / assumptions

  • No test files were modified and no dependencies were added, per task constraints.
  • For icon-only buttons lacking an explicit aria-label, a minimal default accessible name is applied so the button is never nameless to assistive tech.
  • Changes were independently reviewed (verdict: approve) before commit.

- api.ts: import the renamed useDebounce hook (was stale useThrottle)
- date.ts: format day as numeric (no leading zero), keep d/m/y order
- Button: forward aria-label to the DOM element for accessible name
- DataTable: use functional updater to fix stale-closure sort toggle
- tsconfig: reference already-installed bun-types so bun:test resolves
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