fix: resolve cross-package bugs causing test failures#42
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook (useDebounce/useSearchDebounce) from @e2e/utils instead of removed useThrottle - Button: forward aria-label to the DOM element; default icon-only buttons to 'icon button' when no explicit label is supplied - DataTable: fix stale-closure bug caught by controlled re-render test - date: correct locale/format string to day-first (en-GB/en-AU) All 13 tests pass; no source type errors.
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 source type errors across the monorepo (
packages/ui,packages/utils,apps/web). Four distinct cross-package bugs were causing 5 test failures and a type error. All 13 tests now pass andtsc --noEmitreports no source-file errors.Bugs fixed
apps/web/src/lib/api.ts) — the consumer importeduseThrottlefrom@e2e/utils, which no longer exists. Updated to import the actual exported hook (useDebounce/useSearchDebounce), clearing the dangling import and the TS error.packages/ui/src/components/Button/Button.tsx) —aria-labelwas not reaching the rendered<button>. Now forwarded to the DOM element; icon-only buttons fall back to a meaningful default ("icon button") when no explicit label is supplied, and an explicitaria-labelis never clobbered.packages/ui/src/components/DataTable/DataTable.tsx) — a callback captured stale state/props across re-renders, caught by the controlled re-render test. Fixed.packages/utils/src/format/date.ts) —formatDateproduced a month-first format; corrected to day-first so1 March 2024→01/03/2024.Verification
bun run test→ 13 pass, 0 failbunx tsc --noEmit→ no source-file errorsAssumptions
aria-label, so a descriptive generic ("icon button") was chosen for better screen-reader semantics (WCAG 2.4.6).🤖 Generated autonomously