Skip to content

fix: resolve cross-package test failures in monorepo - #116

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2284-1786551802
Open

fix: resolve cross-package test failures in monorepo#116
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2284-1786551802

Conversation

@stooit

@stooit stooit commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests across the monorepo (now 13 pass / 0 fail) and eliminates the associated type error. Bugs spanned all three packages.

Fixes

  • packages/utils — hook rename mismatch. The debounce hook export and apps/web/src/lib/api.ts import were out of sync (useThrottle vs the expected useSearchDebounce). Aligned the export to useSearchDebounce and updated the app import. This also clears the tsc error Module '@e2e/utils' has no exported member 'useThrottle'.
  • packages/ui — Button accessibility (WCAG 2.2 SC 4.1.2). aria-label is now forwarded to the DOM button, and icon-only buttons get a sensible default accessible name (with a dev warning) when none is supplied, so they never ship unnamed.
  • packages/ui — DataTable stale-closure sort. Sort key + direction merged into a single functional state update so repeated header clicks toggle ascending → descending correctly (previously a captured value caused the second click not to flip direction).
  • packages/utils — date format. formatDate now uses the en-AU day-first format without a leading zero on the day (1/03/2024 for 1 March 2024). Other date/currency tests remain green.

Verification

  • bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts13 pass, 0 fail
  • npx tsc --noEmit → clean except for pre-existing Cannot find module 'bun:test' errors in test files (test-config noise, unrelated to these bugs; test files were not modified per task constraints).

Constraints honoured

  • No test files modified.
  • No new dependencies added.
  • Only the four source files required by the failing tests were changed.

Notes / follow-ups (non-blocking, out of scope)

  • The formatDate module-scoped Intl.DateTimeFormat caches the ambient timezone; consider pinning timeZone: "Australia/Sydney" so near-midnight UTC timestamps render the correct calendar day regardless of server TZ.
  • Consider tightening the Button type so aria-label is required when iconOnly is true (requires a test update, hence deferred).

- utils: rename hook export to useSearchDebounce and align api.ts import
- ui/Button: forward aria-label and default an accessible name for icon-only buttons (WCAG 4.1.2)
- ui/DataTable: fix stale-closure sort toggle using merged functional state update
- utils/date: use en-AU day-first format without leading-zero day
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