Skip to content

fix: repair cross-package test and type failures#70

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2292-1783616300
Open

fix: repair cross-package test and type failures#70
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2292-1783616300

Conversation

@stooit

@stooit stooit commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo. bun test13 pass, 0 fail; tsc --noEmitexit 0, no errors.

Root causes & fixes

  1. apps/web/src/lib/api.ts — Hook was renamed useThrottleuseDebounce in packages/utils, but the old name was still imported/re-exported. Updated the import and the useSearchDebounce re-export.
  2. packages/utils/src/format/date.tsformatDate produced a leading-zero day (01/03/2024). Rewrote to output DD/MM/YYYY with unpadded day and zero-padded month (1/03/2024), using UTC accessors.
  3. bunfig.toml — Component tests failed with document is not defined from the repo root because the happy-dom setup wasn't preloaded. Added preload of the UI test setup.
  4. packages/ui/src/components/Button/Button.tsx — Icon-only buttons never applied an accessible name. Now always applies aria-label.
  5. packages/ui/src/components/DataTable/DataTable.tsx — Stale-closure bug in the sort toggle. Switched to a functional state updater so a second click toggles to descending.
  6. tsconfig.json — Added bun-types to compilerOptions.types (already installed) so bun:test resolves, and included app sources. Resolves the 4 pre-existing Cannot find module 'bun:test' errors.

Verification

  • bun test: 13 pass, 0 fail
  • node_modules/.bin/tsc --noEmit: exit 0

Constraints honoured

  • No test files modified. No dependencies added (bun-types already present). Changes minimal, root-cause fixes, independently reviewed.

Assumptions

  • The useThrottleuseDebounce rename is intentional; the fix updates consumers rather than restoring the old export.
  • formatDate is expected to be UTC-based / locale-independent (matches all date-test assertions).

- api.ts: update import to renamed useDebounce hook (was useThrottle)
- date.ts: format 1 March 2024 as 1/03/2024 (DD/MM/YYYY, UTC)
- bunfig.toml: preload happy-dom setup so DOM globals exist at repo root
- Button.tsx: always apply aria-label on icon-only buttons
- DataTable.tsx: functional setState to fix stale-closure sort toggle
- tsconfig.json: add bun-types and include app sources for type checking
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