fix: resolve all failing tests and type errors across monorepo - #104
Open
stooit wants to merge 1 commit into
Open
fix: resolve all failing tests and type errors across monorepo#104stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: correct renamed hook import (useThrottle -> useDebounce) - Button: apply aria-label for iconOnly buttons + dev-only warning (WCAG 4.1.2) - DataTable: fix stale-closure in sort toggle via functional setState - date.ts: formatDate emits day-first D/MM/YYYY without day zero-padding - tsconfig: load bun-types so bun:test resolves under tsc All 13 tests pass; tsc --noEmit is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 5 failing tests and eliminates all TypeScript errors across the
packages/ui,packages/utils, andapps/webworkspaces.bun run test→ 13 pass / 0 fail andtsc --noEmit→ clean.Root causes & fixes
apps/web/src/lib/api.tsuseThrottle, which no longer exists (TS2305)useDebounce; the app-facinguseSearchDebouncealias is preservedpackages/ui/src/components/Button/Button.tsxaria-labelwas declared inPropsbut never applied, so icon-only buttons had no accessible namearia-labelwith a fallback foriconOnly, plus a dev-only warning when an icon-only button is unlabelled (WCAG 2.2 SC 4.1.2)packages/ui/src/components/DataTable/DataTable.tsxsetSortDir(prev => …)packages/utils/src/format/date.tsformatDatezero-padded the day (01/03/2024), failing the/^1/assertionD/MM/YYYYwith no leading zero on the daytsconfig.jsonbun:testunresolved undertsc(4×TS2307)"types": ["bun-types"](already a devDependency)Verification
Constraints honoured
bun-typeswas already a devDependency).Assumptions & notes for reviewers
formatDatewas day zero-padding, not field order — the original already emitted day-first. The fix targets the padding only.aria-labelprop now also flows through to text buttons (previously inert). No test exercises that path; flagged as a WCAG 2.5.3 follow-up, not changed here since no test requires it.formatDatehas notimeZoneoption so it renders in system TZ; andDataTable's sort control is a click handler on a non-focusable<th>(keyboard operability, WCAG 2.1.1). Both worth follow-up tickets.Investigation plan retained at
docs/plans/2026-08-01-fix-5-failing-tests-and-tsc-error.md.