diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index 2d4731b..c917f89 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -1,14 +1,8 @@ /** * API client utilities for the web app. - * - * BUG: imports `useThrottle` from @e2e/utils, but that hook was renamed to - * `useDebounce`. This causes a TypeScript error and a runtime crash. - * - * 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" @@ -28,5 +22,5 @@ export async function fetchPosts() { // Re-export formatting utilities used throughout the app export { formatDate, formatAUD } -// Re-export the debounce hook (currently broken import) -export { useThrottle as useSearchDebounce } +// Re-export the debounce hook under the app-local name +export { useDebounce as useSearchDebounce } diff --git a/docs/plans/2026-08-01-fix-5-failing-tests-and-tsc-error.md b/docs/plans/2026-08-01-fix-5-failing-tests-and-tsc-error.md new file mode 100644 index 0000000..22c46d5 --- /dev/null +++ b/docs/plans/2026-08-01-fix-5-failing-tests-and-tsc-error.md @@ -0,0 +1,243 @@ +# Fix plan — 5 failing tests + 1 tsc error + +**Date:** 2026-08-01 +**Branch:** `quantcode/e2e-tier3-2301-1785624453` +**Verify with:** `bun run test` and `bun run typecheck` +**Constraint:** source files only — do NOT edit any file under a `test/` directory. + +## Status: all fixes pre-verified + +Applied to a scratch copy of the repo, then reverted. Result: **13 pass / 0 fail** (was 8 pass / 5 fail), +and `tsc --noEmit --types bun-types,react` clean. The four edits below are exactly what was validated. + +Baseline failures confirmed: + +| # | Test | Cause | +|---|------|-------| +| 1 | `api.test.ts` — both tests | `SyntaxError: export 'useSearchDebounce' not found in '@e2e/utils'` + `TS2305` | +| 2 | `Button.test.tsx` — 2 aria-label tests | `aria-label` never applied to `