Skip to content

fix: resolve cross-package bugs causing test failures#42

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2469-1781562920
Open

fix: resolve cross-package bugs causing test failures#42
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2469-1781562920

Conversation

@stooit

@stooit stooit commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and source type errors across the monorepo (packages/ui, packages/utils, apps/web). Four distinct cross-package bugs were causing 5 test failures and a type error. All 13 tests now pass and tsc --noEmit reports no source-file errors.

Bugs fixed

  1. Renamed hook still imported under old name (apps/web/src/lib/api.ts) — the consumer imported useThrottle from @e2e/utils, which no longer exists. Updated to import the actual exported hook (useDebounce/useSearchDebounce), clearing the dangling import and the TS error.
  2. Button missing accessibility attribute (packages/ui/src/components/Button/Button.tsx) — aria-label was not reaching the rendered <button>. Now forwarded to the DOM element; icon-only buttons fall back to a meaningful default ("icon button") when no explicit label is supplied, and an explicit aria-label is never clobbered.
  3. Stale-closure bug (packages/ui/src/components/DataTable/DataTable.tsx) — a callback captured stale state/props across re-renders, caught by the controlled re-render test. Fixed.
  4. Wrong date locale/format (packages/utils/src/format/date.ts) — formatDate produced a month-first format; corrected to day-first so 1 March 202401/03/2024.

Verification

  • bun run test → 13 pass, 0 fail
  • bunx tsc --noEmit → no source-file errors

Remaining Cannot find module 'bun:test' tsc warnings exist only in test files, which the task forbade modifying. Pre-existing test-tooling noise, unrelated to the bugs.

Assumptions

  • Test files are the source of truth for expected behaviour and were left untouched.
  • No new dependencies added; only the four source files above changed.
  • For the icon-only Button fallback, the test only asserts a non-null aria-label, so a descriptive generic ("icon button") was chosen for better screen-reader semantics (WCAG 2.4.6).

🤖 Generated autonomously

- api.ts: import renamed hook (useDebounce/useSearchDebounce) from @e2e/utils
  instead of removed useThrottle
- Button: forward aria-label to the DOM element; default icon-only buttons to
  'icon button' when no explicit label is supplied
- DataTable: fix stale-closure bug caught by controlled re-render test
- date: correct locale/format string to day-first (en-GB/en-AU)

All 13 tests pass; no source 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