Conversation
- utils: formatDate strips en-AU day pad via formatToParts (D/MM/YYYY, 4-digit year) - ui: Button forwards aria-label to the element with an icon-only fallback + dev warn [WCAG 2.2 SC 4.1.2] - web: api.ts imports useDebounce after upstream useThrottle rename - tsconfig: scope bun-types via bun-env.d.ts so bun:test resolves without an @types allow-list All 13 tests pass; tsc --noEmit is clean. No test files or dependencies changed.
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 8 pass / 5 fail with 5
tsc --noEmiterrors; now 13 pass / 0 fail andtsc --noEmitis clean. The bugs spanned all three workspaces (packages/utils,packages/ui,apps/web).Changes
packages/utils/src/format/date.ts—formatDatereturned a zero-padded day (01/03/2024) because theen-AUCLDR data coercesday: "numeric"to 2-digit. Rewrote it to useIntl.DateTimeFormat(...).formatToParts()and strip the day pad, keeping theen-AUlocale, day-first order, and a 4-digit year (1/03/2024). Corrected the misleadingBUG:docblock.packages/ui/src/components/Button/Button.tsx—aria-labelwas destructured but never applied to the<button>element (there is no{...rest}spread). Now forwarded to the element, with an icon-only fallback (explicit label → stringchildren→"Button") and a dev-modeconsole.warnwhen aniconOnlybutton has no explicit label. Text buttons remain unaffected (attribute omitted whenundefined). [WCAG 2.2 SC 4.1.2]apps/web/src/lib/api.ts— theuseThrottlehook was renamed touseDebouncein@e2e/utils(identical signature). Updated the import and theas useSearchDebouncere-export; removed the staleBUG:docblock.tsconfig.json+bun-env.d.ts—bun:testdidn't resolve undertsc. Added a scoped/// <reference types="bun-types" />in a new rootbun-env.d.ts(added toinclude) rather than atypesallow-list, so automatic@typesinclusion is preserved.Verification
bun run test→ 13 pass / 0 fail./node_modules/.bin/tsc --noEmit→ exit 0, no errorsAssumptions / notes
handleSortis recreated each render with the currentsortDirandfireEvent.clickflushes state between clicks viaact(). No change was required; making one would have been speculative.@testing-library/jest-dommatcher types are not currently wired intobun:test(unchanged from baseline — wiring them would require editing a test-setup file, which was out of scope here).