Skip to content

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

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2400-1782060181
Open

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

Conversation

@stooit

@stooit stooit commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and TypeScript errors in the monorepo. bun run test -> 13 pass / 0 fail; tsc --noEmit -> clean (exit 0). No test files modified, no dependencies added.

Bugs fixed

  • utils — hook rename mismatch: the hook was renamed but apps/web still imported the old useThrottle. The barrel (packages/utils/src/index.ts) now exports useSearchDebounce and apps/web/src/lib/api.ts imports that name. Behaviour unchanged.
  • ui/Button — missing accessibility attribute: aria-label is now passed through to the underlying <button>, and icon-only buttons receive a fallback aria-label so they always have an accessible name.
  • ui/DataTable — stale closure: the sort handler captured sortDir at creation time; switched to a functional state updater (setSortDir(prev => ...)) so the controlled re-render test passes. Stale BUG comments removed.
  • utils/date — wrong format: formatDate now uses day-first locale formatting without a leading zero on the day (e.g. 1/03/2024), matching the test contract.

Config

  • tsconfig.json now includes bun-types (already in node_modules) so the bun:test module resolves — this clears the remaining tsc --noEmit errors without touching test files.

Verification

  • bun run test -> 13 pass, 0 fail
  • ./node_modules/.bin/tsc --noEmit -> no errors

Assumptions

  • Ran the package's test script (bun run test), which preloads the DOM setup (packages/ui/test/setup.ts); a bare bun test lacks that preload and reports false DOM failures.
  • The bun:test type errors were a pre-existing tsconfig gap (not a test-file bug), fixed via config rather than editing tests.

- utils: rename hook export to useSearchDebounce and update apps/web consumer
- ui/Button: pass aria-label through and default it for icon-only buttons
- ui/DataTable: fix stale-closure in sort handler via functional state update
- utils/date: use day-first locale without leading-zero day (1/03/2024)
- tsconfig: include bun-types so bun:test resolves (clears tsc 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