Skip to content

fix: repair cross-package monorepo bugs (all tests + typecheck pass) - #121

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2221-1786896488
Open

fix: repair cross-package monorepo bugs (all tests + typecheck pass)#121
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2221-1786896488

Conversation

@stooit

@stooit stooit commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors in the monorepo. Baseline was 4 pass / 9 fail with 4 tsc errors; now 13 pass / 0 fail and tsc --noEmit exits 0.

Four cross-package bugs plus two test-environment/config gaps, all fixed with minimal changes. No test files modified, no new dependencies added.

Changes

File Fix
apps/web/src/lib/api.ts Hook useThrottle was renamed to useDebounce in @e2e/utils but the old name was still imported/re-exported. Updated import + useDebounce as useSearchDebounce re-export.
packages/ui/src/components/Button/Button.tsx Icon-only buttons rendered no accessible name. Now forwards aria-label to the element (with a dev-only warning + generic fallback when omitted on iconOnly), satisfying WCAG 2.2 SC 4.1.2.
packages/utils/src/format/date.ts formatDate produced US-style 01/03/2024. Now emits en-AU day-first 1/03/2024 (unpadded day, zero-padded month, 4-digit year) via formatToParts.
bunfig.toml Root config used an inert happy-dom environment key, so bun test from the repo root had no DOM globals. Replaced with preload of the ui package's setup file.
tsconfig.json Added "types": ["bun-types"] so bun:test resolves under tsc --noEmit (bun-types was already a devDependency).

Verification

  • bun test (from repo root): 13 pass / 0 fail
  • bunx tsc --noEmit: exit 0, no errors
  • Each fix reverted in isolation to confirm it addresses a real failure and does not mask it.
  • date.ts spot-checked across multiple dates to confirm it generalises rather than hardcoding the assertion.

Assumptions & notes

  • The DataTable "stale closure" test passes without a source change — each React render creates a fresh sort handler, so sortDir is current across discrete clicks. Left untouched per "fix only what the tests require."
  • The Button aria-label fallback of "Button" is a WCAG 4.1.2 compliance floor, not a meaningful name (a type-required label was not possible because the tsconfig includes test files, one of which renders iconOnly without a label and cannot be modified). A lint rule at call sites is the recommended stronger follow-up.

- api.ts: import renamed useDebounce (was useThrottle) from @e2e/utils
- Button: forward aria-label so icon-only buttons expose an accessible name
- date.ts: format en-AU day-first (1/03/2024) via formatToParts
- bunfig.toml: preload ui DOM setup so component tests run from repo root
- tsconfig.json: add bun-types so bun:test resolves under tsc
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