From 8ae3264e2ff7a4dfe4dc53e2851a67086798de27 Mon Sep 17 00:00:00 2001 From: QuantCode Agent Date: Thu, 18 Jun 2026 03:20:46 +0000 Subject: [PATCH] fix: resolve cross-package test failures and type error - api.ts: import renamed hook useDebounce (was useThrottle) from @e2e/utils - Button: forward aria-label so icon-only buttons have an accessible name - DataTable: fix stale-closure bug caught by controlled re-render test - date.ts: use en-AU locale ordering (day-first) instead of US field order - tsconfig: add bun-types so bun:test test files type-check cleanly --- apps/web/src/lib/api.ts | 5 ++--- packages/ui/src/components/Button/Button.tsx | 7 ++++-- .../ui/src/components/DataTable/DataTable.tsx | 2 +- packages/utils/src/format/date.ts | 22 +++++++++---------- tsconfig.json | 1 + 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index 2d4731b..e9e0a52 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -7,8 +7,7 @@ * Fix: change the import to `useDebounce`. */ -// BUG: useThrottle no longer exists — was renamed to useDebounce -import { useThrottle } from "@e2e/utils" +import { useDebounce } from "@e2e/utils" import { formatDate, formatAUD } from "@e2e/utils" export const BASE_URL = process.env.API_URL ?? "http://localhost:3000" @@ -29,4 +28,4 @@ export async function fetchPosts() { export { formatDate, formatAUD } // Re-export the debounce hook (currently broken import) -export { useThrottle as useSearchDebounce } +export { useDebounce as useSearchDebounce } diff --git a/packages/ui/src/components/Button/Button.tsx b/packages/ui/src/components/Button/Button.tsx index af65c97..9ae324a 100644 --- a/packages/ui/src/components/Button/Button.tsx +++ b/packages/ui/src/components/Button/Button.tsx @@ -34,13 +34,16 @@ export function Button({ onClick, "aria-label": ariaLabel, }: Props) { + if (iconOnly && !ariaLabel) { + console.warn("Button: icon-only buttons require an aria-label for accessibility (WCAG 4.1.2)") + } + const resolvedAriaLabel = ariaLabel ?? (iconOnly ? "" : undefined) return (