fix: repair cross-package bugs failing tests and typecheck - #133
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook useDebounce (was useThrottle) from @e2e/utils - Button: apply aria-label on icon-only buttons with dev warning + fallback - DataTable: use functional setSortDir to fix stale-closure sort toggle - formatDate: emit day-first en-AU output with unpadded day, 4-digit year - tsconfig: add bun-types to types so bun:test resolves
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 across the monorepo.
bun run testnow passes 13/13 andtsc --noEmitexits 0. Five production source files changed; no test files touched, no dependencies added.Bugs fixed
src/lib/api.tsuseThrottlefrom@e2e/utils, but the hook was renamed touseDebounce— caused a runtimeSyntaxErrorand TS2305useDebounce; re-export asuseSearchDebounceButton/Button.tsxaria-labelprop; dev-modeconsole.warn+"Unlabelled button"fallback when icon-only and no label givenDataTable/DataTable.tsxsortDircaptured at handler-creation timesetSortDir(prev => ...)format/date.tsformatDatezero-padded the day (01/03/2024), failing the day-first assertionIntl.DateTimeFormaten-AU withformatToPartsto strip the day's leading zero →1/03/2024(keeps 4-digit year, 2-digit month)tsconfig.jsonbun:testunresolved (TS2307 x4) becausebun-typeslives outside@types/*"types": ["bun-types"]Verification
bun run test-> 13 pass / 0 fail./node_modules/.bin/tsc --noEmit-> exit 0Assumptions & decisions
Intlignores option declaration order and en-AU is already day-first. The real defect was zero-padding. ChoseformatToPartsoverdateStyle: "short"to preserve a 4-digit year (short style silently truncated to1/3/24), avoiding a public-API output regression.aria-labelforiconOnly— the latter is a breaking API change and would require editing the test file, which is out of scope. Fallback is"Unlabelled button"(not"button") so genuinely unlabelled buttons stay greppable/detectable rather than masking the defect.Out of scope (noted, not changed)
<th>elements are mouse-only (notabIndex/role/onKeyDown) — a pre-existing WCAG 2.2 SC 2.1.1 keyboard-access gap not covered by any test. Worth a separate follow-up.