Skip to content

fix: repair 4 cross-package bugs to make test suite pass - #95

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2562-1785107007
Open

fix: repair 4 cross-package bugs to make test suite pass#95
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2562-1785107007

Conversation

@stooit

@stooit stooit commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests in the monorepo. Suite went from 8 pass / 5 fail → 13 pass / 0 fail. The only source type error (useThrottle TS2305) is resolved.

Four cross-package bugs, one per hinted area:

Area File Fix
Renamed hook apps/web/src/lib/api.ts Import useDebounce and re-export as useSearchDebounce; repaired the useThrottle import so @e2e/utils exposes the names api.ts consumes. Merged duplicate @e2e/utils imports.
Accessibility packages/ui/src/components/Button/Button.tsx Forward aria-label to the rendered <button> for icon-only buttons (WCAG 2.2 SC 4.1.2).
Stale closure packages/ui/src/components/DataTable/DataTable.tsx Use functional setState in the sort handler to avoid a latent stale-closure across controlled re-renders.
Date format packages/utils/src/format/date.ts Strip zero-padding from the day (day-first, month stays padded).

Verification

  • bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts13 pass / 0 fail
  • npx tsc --noEmit → only 4 pre-existing Cannot find module 'bun:test' errors, all in untouched test files (verified against a stash at HEAD). Resolving those would need bun-types / a tsconfig edit — out of scope under the no-new-deps / no-test-edits constraints.

Assumptions & constraints honoured

  • No test files modified; no dependencies added.
  • Date fix matches the test's /^1/ expectation (non-padded day-first) without altering month padding.
  • DataTable functional-setState change is semantically equivalent for passing paths — hardening against the stale-closure the re-render test exercises.
  • Reviewed via the review subagent: approved, no blockers.

- utils: re-export useDebounce as useSearchDebounce and fix useThrottle
  import so @e2e/utils exposes the names api.ts consumes
- ui/Button: forward aria-label on icon-only buttons (WCAG 2.2 SC 4.1.2)
- ui/DataTable: use functional setState in sort handler to avoid a
  latent stale-closure (opportunistic hardening; semantically equivalent)
- utils/date: strip zero-padding from day in formatDate (day-first)

All 13 tests pass. Remaining tsc bun:test errors are pre-existing in
untouched test files.
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