Skip to content

fix: repair cross-package bugs so all tests and type checks pass#62

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2506-1782879817
Open

fix: repair cross-package bugs so all tests and type checks pass#62
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2506-1782879817

Conversation

@stooit

@stooit stooit commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 failing tests and all tsc --noEmit errors across the monorepo. Bugs spanned three packages plus the root TS config.

Verified green:

  • bun test … --preload ./packages/ui/test/setup.ts13 pass / 0 fail
  • npx tsc --noEmit0 errors

Root causes & fixes

  1. Renamed hook still imported by old nameapps/web/src/lib/api.ts imported useThrottle from @e2e/utils, but the package exports useDebounce. Switched the import and the useSearchDebounce re-export to the real name.

  2. Missing accessibility attributepackages/ui/src/components/Button dropped aria-label. Props now extends React.ButtonHTMLAttributes<HTMLButtonElement> and the component spreads passthrough props onto the <button>, so aria-label, disabled, onClick, etc. all forward. Added a console.warn for icon-only buttons rendered without an aria-label (WCAG 4.1.2).

  3. Wrong date formatformatDate in packages/utils/src/format/date.ts zero-padded the day (01/03/2024). Reimplemented with UTC getters and an unpadded day so 1 March 20241/03/2024, and the result is timezone-deterministic (avoids host-TZ flakiness on the Z-timestamped fixtures).

  4. bun:test unresolved by tsc — root tsconfig.json did not register the already-installed bun-types. Added "types": ["bun-types"] and included apps/*/test/**/* so app tests are in scope.

Constraints honoured

  • No test files modified.
  • No dependencies added (bun-types was already a devDependency).
  • Only the four source/config files above were changed.

Assumptions

  • The Button "no aria-label" test asserts the attribute is present (non-null), so the attribute is kept and paired with a runtime console.warn rather than omitted — this satisfies the test contract while surfacing the accessibility issue.
  • Date fixtures use UTC (Z) timestamps, so getUTC* getters were chosen for deterministic output regardless of the CI host timezone.

🤖 Generated with QuantCode Agent

- api.ts: import the actual useDebounce export (renamed from useThrottle)
  and re-export it as useSearchDebounce
- Button: extend ButtonHTMLAttributes and spread passthrough props so
  aria-label/disabled/onClick forward to the button; warn on icon-only
  buttons missing an aria-label (WCAG 4.1.2)
- date.ts: use UTC getters with an unpadded day so formatDate is
  timezone-deterministic and day 1 is not confused with month 1
- tsconfig: register bun-types and include app tests to resolve bun:test
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