Skip to content

fix: repair cross-package bugs and test environment#45

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2450-1781632173
Open

fix: repair cross-package bugs and test environment#45
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2450-1781632173

Conversation

@stooit

@stooit stooit commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo (bun test && tsc --noEmit now fully green: 13 pass, 0 fail, 0 type errors). Bugs spanned all three packages plus shared config.

Changes

File Fix
apps/web/src/lib/api.ts Hook was renamed in @e2e/utils (useThrottleuseDebounce); updated the import and the useSearchDebounce re-export alias. Resolves the missing-export runtime + TS2305 errors.
packages/utils/src/format/date.ts formatDate used explicit {month,day,year:"numeric"} which rendered month-first (01/03/2024). Switched to en-AU { dateStyle: "short" } for day-first, no-leading-zero output (1/03/2024).
bunfig.toml (root) [test] declared environment = "happy-dom" but had no preload, so DOM globals weren't registered when running from the repo root (document is not defined). Added preload = ["./packages/ui/test/setup.ts"] (the existing happy-dom registrator).
packages/ui/src/components/Button/Button.tsx aria-label prop was destructured but never forwarded; added aria-label={ariaLabel} to the element so the accessible name is set.
packages/ui/src/components/DataTable/DataTable.tsx Stale-closure bug in sort toggle — replaced setSortDir(sortDir === ...) with the functional updater setSortDir(prev => ...).
tsconfig.json (root) Added "types": ["bun-types"] so bun:test resolves under tsc --noEmit.

Assumptions

  • The DOM-environment failure was a config gap (missing preload), not a test bug — fixed in bunfig.toml, no test files were touched.
  • en-AU dateStyle: "short" is the intended locale/format per the date test's day-first, no-leading-zero expectation.
  • Only existing, already-installed packages were wired up; no new dependencies added.

Verification

  • bun test → 13 pass / 0 fail
  • npx tsc --noEmit → exit 0
  • No test files modified.

- api.ts: import renamed hook useDebounce (was useThrottle)
- date.ts: use en-AU dateStyle short for day-first formatting
- bunfig.toml: preload happy-dom setup so DOM globals register from root
- Button.tsx: forward aria-label to button element
- DataTable.tsx: use functional updater for sort direction (stale closure)
- 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