fix: resolve cross-package test failures in monorepo - #116
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: rename hook export to useSearchDebounce and align api.ts import - ui/Button: forward aria-label and default an accessible name for icon-only buttons (WCAG 4.1.2) - ui/DataTable: fix stale-closure sort toggle using merged functional state update - utils/date: use en-AU day-first format without leading-zero day
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 across the monorepo (now 13 pass / 0 fail) and eliminates the associated type error. Bugs spanned all three packages.
Fixes
packages/utils— hook rename mismatch. The debounce hook export andapps/web/src/lib/api.tsimport were out of sync (useThrottlevs the expecteduseSearchDebounce). Aligned the export touseSearchDebounceand updated the app import. This also clears thetscerrorModule '@e2e/utils' has no exported member 'useThrottle'.packages/ui— Button accessibility (WCAG 2.2 SC 4.1.2).aria-labelis now forwarded to the DOM button, and icon-only buttons get a sensible default accessible name (with a dev warning) when none is supplied, so they never ship unnamed.packages/ui— DataTable stale-closure sort. Sort key + direction merged into a single functional state update so repeated header clicks toggle ascending → descending correctly (previously a captured value caused the second click not to flip direction).packages/utils— date format.formatDatenow uses theen-AUday-first format without a leading zero on the day (1/03/2024for 1 March 2024). Other date/currency tests remain green.Verification
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts→ 13 pass, 0 failnpx tsc --noEmit→ clean except for pre-existingCannot find module 'bun:test'errors in test files (test-config noise, unrelated to these bugs; test files were not modified per task constraints).Constraints honoured
Notes / follow-ups (non-blocking, out of scope)
formatDatemodule-scopedIntl.DateTimeFormatcaches the ambient timezone; consider pinningtimeZone: "Australia/Sydney"so near-midnight UTC timestamps render the correct calendar day regardless of server TZ.aria-labelis required wheniconOnlyis true (requires a test update, hence deferred).