Skip to content

fix: resolve failing tests and type errors across ui, utils and web packages - #197

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2221-1790958005
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2221-1790958005

Conversation

@stooit

@stooit stooit commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

bun test (13/13) and tsc --noEmit now both pass.

  • apps/web/src/lib/api.ts: the hook was renamed useThrottle → useDebounce in packages/utils, so I updated the import and re-export to the new name.
  • packages/ui Button: aria-label was never applied to the <button>. It's now applied, falling back to string children, then to "Button".
  • packages/ui DataTable: stale closure in the sort toggle. It now uses a functional update, setSortDir(prev => …).
  • packages/utils formatDate: the day was zero-padded (01/03/2024). It now uses dateStyle: "short" with en-AU.
  • bunfig.toml: environment = "happy-dom" isn't a Bun option, so I replaced it with preload pointing at the existing test setup.
  • tsconfig.json: added "types": ["bun-types"]. The package was already a devDependency.

No test files changed and no dependencies added.

Assumptions / reviewer notes

  • formatDate now outputs D/M/YY (e.g. 15/6/24). Every explicit-field option zero-pads in en-AU and fails the test. Please confirm the 2-digit year is acceptable.
  • The "Button" fallback label satisfies the test, but it doesn't describe anything to a screen-reader user (WCAG 2.2 SC 4.1.2). A follow-up could make aria-label required when iconOnly is set. That changes the public API and would break the current test.
  • tsc isn't on PATH here, so I ran it as bunx tsc.

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