Skip to content

fix: repair failing tests and type errors across monorepo - #100

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2213-1785342903
Open

fix: repair failing tests and type errors across monorepo#100
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2213-1785342903

Conversation

@stooit

@stooit stooit commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors so bun test && tsc --noEmit passes cleanly (13 pass / 0 fail, tsc exit 0; baseline was 4 pass / 9 fail with 6 type errors). Bugs spanned all three packages.

Fixes

  • apps/web/src/lib/api.ts — the useThrottle hook was renamed in packages/utils (now useDebounce); updated the stale import and usage. (Resolves TS2305: Module '@e2e/utils' has no exported member 'useThrottle'.)
  • packages/ui/src/components/Button/Button.tsx — added the required aria-label for iconOnly buttons (WCAG 2.2 SC 4.1.2), asserted by the Button test.
  • packages/ui/src/components/DataTable/DataTable.tsx — fixed a stale-closure bug in the sort toggle (functional state updater) so "sorts descending on second click" passes under controlled re-render.
  • packages/utils/src/format/date.ts — corrected date formatting to produce a non-padded day so 2024-03-01 renders as 1/03/2024.

Test-environment / config fixes (no test files modified, no deps added)

  • bunfig.toml — replaced an inert environment setting with a preload of the existing DOM setup script, resolving ReferenceError: document is not defined from @testing-library/react's render().
  • tsconfig.json — added bun-types to compilerOptions.types (already in node_modules) to resolve Cannot find module 'bun:test'.

Constraints honoured

  • No test files modified. No new dependencies added. Only changes required by the failing tests/type errors.

Assumptions

  • The bunfig.toml preload of the pre-existing UI test setup script is the intended DOM wiring.
  • useDebounce is the correct, signature-compatible replacement for the renamed useThrottle at the api.ts call site.

- utils: rename stale useThrottle import to useDebounce in apps/web api
- ui/Button: add aria-label for iconOnly (WCAG 2.2 SC 4.1.2)
- ui/DataTable: fix stale-closure in sort toggle via updater form
- utils/date: use formatToParts for correct non-padded day locale output
- test env: preload DOM setup in bunfig.toml; add bun-types to tsconfig
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