Skip to content

fix: repair cross-package bugs breaking tests and type checks#65

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2459-1783182479
Open

fix: repair cross-package bugs breaking tests and type checks#65
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2459-1783182479

Conversation

@stooit

@stooit stooit commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and type errors across the monorepo (bun run test → 13/13 pass; bun run typecheck → clean). Bugs spanned all three packages.

Changes

  • packages/utils/src/format/date.tsformatDate now renders day and month without leading zeros for en-AU (e.g. 1/3/2024), fixing the "day 1 not confused with month 1" test. Uses Intl.DateTimeFormat.formatToParts because Bun's ICU zero-pads numeric day.
  • apps/web/src/lib/api.ts — the hook was renamed in packages/utils; updated the import from the non-existent useThrottle to useDebounce and fixed the useSearchDebounce re-export (resolves TS2305 + the api module test).
  • packages/ui/src/components/Button/Button.tsx — icon-only buttons now pass through aria-label verbatim, and emit a dev console.warn (WCAG 4.1.2) when an icon-only button is missing an accessible name, matching the test's "should warn" intent.
  • packages/ui/src/components/DataTable/DataTable.tsx — fixed a stale-closure bug in the sort-direction toggle by using the functional updater form of setSortDir, caught by the controlled re-render test.
  • tsconfig.json — registered bun-types (already installed) so test files resolve bun:test (resolves TS2307).

Verification

  • bun run test13 pass, 0 fail
  • bun run typecheck0 errors

Constraints honoured

  • No test files modified.
  • No dependencies added (bun-types was already present).
  • Only the code the tests required was changed.

Assumptions

  • The renamed hook is useDebounce (verified as the actual export in packages/utils); useSearchDebounce is the public alias the app/test expects.
  • For a missing icon-only aria-label, the test requires a warning (not a placeholder label); implemented as console.warn.
  • Day/month rendered unpadded (1/3/2024) as the simplest form satisfying every date assertion.

- utils: format day/month without leading zeros in formatDate (en-AU)
- utils/web: rename hook to useDebounce; re-export as useSearchDebounce
- ui: pass through aria-label on icon-only Button, warn when missing
- ui: fix stale-closure in DataTable sort toggle via functional updater
- tsconfig: register bun-types so bun:test resolves in 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