Skip to content

fix: repair cross-package bugs so all tests and tsc pass#72

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2422-1783786978
Open

fix: repair cross-package bugs so all tests and tsc pass#72
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2422-1783786978

Conversation

@stooit

@stooit stooit commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo. bun test reports 13 pass / 0 fail and tsc --noEmit is clean. No test files modified; no dependencies added.

Bugs fixed

# File Bug Fix
1 apps/web/src/lib/api.ts Imported/re-exported renamed hook useThrottle (no longer exported by @e2e/utils) Import & re-export useDebounce (canonical name) as useSearchDebounce
2 packages/utils/src/format/date.ts Zero-padded day (01/03/2024) and risk of day/month confusion Use Intl.DateTimeFormat("en-AU", { dateStyle: "short" })d/MM/yyyy (no leading-zero day, local-time safe)
3 bunfig.toml Root test runs lacked a happy-dom preload → document is not defined in UI tests Add preload of the UI happy-dom setup to [test]
4 packages/ui/src/components/Button/Button.tsx ariaLabel prop destructured but never applied Apply aria-label to the <button>
5 packages/ui/src/components/DataTable/DataTable.tsx Stale-closure sort toggle caught by controlled re-render test Use functional updater setSortDir(prev => ...)
6 tsconfig.json bun:test unresolved (TS2307) Add "types": ["bun-types"]

Verification

  • bun test → 13 pass / 0 fail
  • npx tsc --noEmit → clean
  • No files under test/ or *.test.* were changed.

Assumptions

  • The canonical hook export in @e2e/utils is useDebounce (confirmed in packages/utils/src/index.ts).
  • en-AU short date style is the intended format the date test targets; chosen over manual UTC extraction to avoid an off-by-one for non-UTC-timezone callers.
  • Reviewed via the review subagent; the only finding (UTC off-by-one) was addressed by the locale-based formatter.

- api.ts: import/re-export renamed hook (useThrottle -> useDebounce)
- date.ts: use en-AU short locale for d/MM/yyyy without leading-zero day
- bunfig.toml: preload happy-dom setup so UI tests have a DOM
- Button.tsx: apply aria-label prop to the button element
- DataTable.tsx: fix stale-closure sort toggle via functional updater
- tsconfig.json: add bun-types so bun:test resolves
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