Skip to content

fix: resolve cross-package test failures and type errors - #185

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2278-1790225190
Open

stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2278-1790225190

Conversation

@stooit

@stooit stooit commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

bun test && tsc --noEmit now passes: 13 tests pass, 0 fail, and tsc exits 0. No test files or dependencies were changed.

  • apps/web/src/lib/api.ts: the import used the old name useThrottle. It now imports useDebounce, which is what @e2e/utils exports.
  • Button.tsx: icon-only buttons now always get an aria-label. The fallback now uses || instead of ??, so an empty label also falls back. When no label is given it falls back to string children, then to "Button". A warning still prints in dev mode.
  • DataTable.tsx: fixed a stale-closure bug in the sort toggle by using the functional form of setState.
  • date.ts: formatDate now gives en-AU d/MM/yyyy output, for example 1/03/2024. formatDateTime now reuses formatDate for its date part.
  • tsconfig.json: added "types": ["bun-types"] so tsc can find bun:test. bun-types was already installed.
  • bunfig.toml: this Bun version ignores environment = "happy-dom", so a plain bun test failed with document is not defined. I replaced it with a preload of the existing packages/ui/test/setup.ts.

Assumptions

  • The formatDateTime output changes (1/3/24 becomes 1/03/2024) even though no test covers it. I kept it so it matches the DD/MM/YYYY format the docs describe; it can be reverted if preferred.
  • Dates are still formatted in the host's timezone. I didn't hard-code a timezone.
  • The generic "Button" fallback label is only a safety net; callers should pass a real aria-label.

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