fix: repair cross-package bugs failing the test suite - #125
Open
stooit wants to merge 1 commit into
Open
Conversation
- web: reconcile renamed hook — import useDebounce and re-export as useSearchDebounce (was importing the removed useThrottle) - ui: apply aria-label on icon-only Button for WCAG 2.2 SC 4.1.2 - utils: format dates day-first without zero-padding (en-GB, day numeric) - tsconfig: add bun-types so tsc resolves bun:test (pre-existing devDep)
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 failing tests and type errors in the monorepo. Baseline was 5 failing tests + 1 tsc error spanning three packages; now 13/13 tests pass and
tsc --noEmitis clean.Changes
apps/web/src/lib/api.ts— the utility hook was renamed touseDebounceinpackages/utils, butapps/webstill imported the removeduseThrottle. Updated the import and re-exported it asuseSearchDebounce(the consumer-facing name the test asserts).packages/utilswas already exporting the renamed hook, so no util change was needed and no other consumer breaks.packages/ui/.../Button/Button.tsx— icon-only buttons never applied anaria-label(a comment sat where the attribute belonged), failing WCAG 2.2 SC 4.1.2. Now applies the explicit label, falls back to string children then a default, and warns in dev when unlabelled.packages/utils/src/format/date.ts— dates were zero-padding the day (01/03/2024). The test requires day-first, non-padded (1/03/2024). Switched toen-GBwithday: "numeric", which honours the non-padded day while keeping a 4-digit year (the in-file comment's suggesteddateStyle: 'short'fix would have regressed the year to 2 digits).tsconfig.json— added"types": ["bun-types"]to resolve pre-existingCannot find module 'bun:test'errors.bun-typeswas already a devDependency — no new dependency added.Verification
Notes / assumptions
handleSortis re-created each render and closes over the currentsortDir, so double-click correctly reachesdescdespite theBUG:comment.bun testdocument is not definederrors were a false signal — the real entrypoint is thetestnpm script, which preloadspackages/ui/test/setup.tsfor the DOM.