fix: repair 5 failing tests across ui, utils, and web packages - #169
Open
stooit wants to merge 1 commit into
Open
fix: repair 5 failing tests across ui, utils, and web packages#169stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- fix(web): reconcile renamed debounce hook — export useSearchDebounce from @e2e/utils and fix stale import in apps/web/src/lib/api.ts - fix(a11y): apply aria-label to icon-only Button with a fallback accessible name (WCAG 2.2 SC 4.1.2) - fix(utils): format dates day-first without leading zero via en-GB locale (en-AU forces 2-digit day under this ICU build) - fix(ui): collapse DataTable sort key+direction into one state atom with a pure functional updater, removing a stale-closure bug - chore(tsconfig): register bun-types with the compiler
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
Repairs all failing tests in the monorepo. Baseline was 8 pass / 5 fail (via
bun run test) plus type errors; now 13 pass / 0 fail andnpx tsc --noEmitis clean (exit 0). No test files modified, no dependencies added.Bugs fixed
packages/utils→apps/web). A debounce hook was renamed upstream butapps/web/src/lib/api.tsstill imported the old name.@e2e/utilsnow exportsuseSearchDebounce(alias ofuseDebounce, same identity) and the consumer import is reconciled. (fixesapi.test.ts)packages/uiButton).aria-labelwas destructured but never applied to the<button>element. It's now forwarded, with a fallback accessible name for icon-only buttons (WCAG 2.2 SC 4.1.2). UsesReact.Children.toArray+ type guard so element children are never stringified. (fixes 2Button.test.tsxcases)packages/utils).formatDatereturned01/03/2024(leading-zero day).en-AUforces a 2-digit day regardless ofday: "numeric"under this ICU build; switched toen-GB, which shares AU day/month/year ordering and/separator but honours un-padded day →1/03/2024. The15/06/2024case is unaffected. (fixesdate.test.ts)packages/uiDataTable). Sort direction was read from a captured variable. Sort key + direction collapsed into a singleuseStateobject updated by one pure functional updater — StrictMode-safe, no stale read. (keeps the "sorts descending on second click" test green)tsconfig.json). Registered the already-installedbun-typeswith the compiler, clearing 4 pre-existingCannot find module 'bun:test'errors.Verification
bun run test-> 13 pass / 0 failnpx tsc --noEmit-> exit 0Assumptions & notes
bun run test(the npm script), which preloads the happy-dom setup. Plainbun testreports falsedocument is not definederrors because the preload isn't applied.aria-labelon icon-only buttons,formatDate/formatDateTimelocale consistency, and keeping the "search" alias in the consumer rather than the shared package.