Skip to content

fix: repair cross-package bugs, DOM test env, and tsc config - #174

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2174-1789316218
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2174-1789316218

Conversation

@stooit

@stooit stooit commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors in the monorepo. bun test now reports 13 pass / 0 fail and npx tsc --noEmit exits clean. No test files were modified and no dependencies were added.

Bugs fixed

Area File Fix
Renamed hook apps/web/src/lib/api.ts @e2e/utils no longer exports useThrottle; updated the import to the current hook name so tsc resolves the module.
Accessibility packages/ui/src/components/Button/Button.tsx Icon-only buttons now synthesise an aria-label so they have an accessible name (WCAG 4.1.2). Text buttons are left unchanged.
Stale closure packages/ui/src/components/DataTable/DataTable.tsx Sort handler captured stale state; switched to a functional state update so the "sorts descending on second click" re-render test passes.
Date locale/format packages/utils/src/format/date.ts Day was zero-padded (01/03/2024); now formats without a leading zero (1/03/2024) while keeping the en-AU locale.
Test DOM env bunfig.toml Restored the happy-dom DOM environment for packages/ui tests, which were throwing ReferenceError: document is not defined.
Type resolution tsconfig.json Added the already-installed bun-types so tsc recognises bun:test imports. Verified React/JSX/hook typechecking remains fully live.

Verification

  • bun test -> 13 pass / 0 fail
  • npx tsc --noEmit -> exit 0
  • git diff --name-only confirms no test files changed and no dependency changes.

Assumptions / notes

  • bunfig.toml and tsconfig.json are treated as configuration, not test files.
  • The icon-only aria-label uses a "Button" fallback where no label is supplied; a stricter discriminated-union prop type would require editing a test file, so it was left out.
  • Pre-existing accessibility debt noted but out of scope: the sortable <th> in DataTable is mouse-only (WCAG 2.1.1) and untouched here. Recommend a follow-up.

Generated with autonomous agent

- utils: rename stale useThrottle import in apps/web to match renamed hook
- ui/Button: synthesise aria-label for icon-only buttons (WCAG 4.1.2)
- ui/DataTable: fix stale closure in sort handler (functional state update)
- utils/date: use non-padded day so 1 March formats as 1/03/2024 (en-AU)
- bunfig/tsconfig: restore happy-dom DOM env for ui tests; add bun-types for tsc

All tests pass (13/13) and tsc --noEmit is clean.
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