Skip to content

fix: resolve cross-package test failures and type errors#43

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2468-1781580066
Open

fix: resolve cross-package test failures and type errors#43
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2468-1781580066

Conversation

@stooit

@stooit stooit commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests and clears all tsc --noEmit errors across the monorepo (packages/ui, packages/utils, apps/web). Each fix targets the root-cause source bug; no test files were modified and no dependencies were added.

Gate status

  • bun run test13 pass, 0 fail (5 files)
  • tsc --noEmit0 errors (exit 0)

Fixes

Package Bug Fix
packages/utils Hook renamed; consumers import useSearchDebounce which was no longer exported (SyntaxError) Export the hook under the expected useSearchDebounce name from @e2e/utils; updated the apps/web/src/lib/api.ts import site to match
packages/utils formatDate returned 01/03/2024 (zero-padded day); test expects 1/03/2024 Format string changed to unpadded day + padded month (d/MM/yyyy, en-AU style)
packages/ui Icon-only Button did not forward aria-label to the rendered <button> (WCAG 4.1.2) Forward aria-label (and rest a11y props) onto the underlying button element
packages/ui DataTable stale-closure bug caught by a controlled re-render test Use functional state update so the handler no longer closes over a stale value
tsconfig.json Pre-existing Cannot find module 'bun:test' type errors in test files Added bun-types to compilerOptions.types (config only — already-installed types, no new dependency, no test files touched)

Verification

  • Independently re-ran both gates after the fixes — both green.
  • Diff reviewed by the review agent: APPROVE — fixes confirmed correct, minimal, root-cause (not test-masking), with no regressions to other call sites.

Assumptions

  • Ran the suite via bun run test (the configured script that preloads the happy-dom registrar); plain bun test skips the preload and cannot mount React components.
  • The bun:test tsc errors pre-existed on the base commit and appear only in test files; resolved them via the tsconfig types entry rather than editing the forbidden test files.
  • useSearchDebounce was treated as the canonical exported name because the test asserts that export exists.

- utils: re-export renamed useDebounce hook as useSearchDebounce for consumers
- utils: formatDate now uses unpadded day (d/MM/yyyy), e.g. 1/03/2024
- ui: Button forwards aria-label to the underlying <button> (WCAG 4.1.2)
- ui: DataTable sort toggle uses functional setState to fix stale closure
- tsconfig: add bun-types to compilerOptions.types to resolve bun:test typings
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