fix: repair cross-package bugs so tests and typecheck pass - #171
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook (useDebounce) from @e2e/utils instead of removed useThrottle - Button: apply aria-label so icon-only buttons expose an accessible name (WCAG 4.1.2) - DataTable: consolidate sort key/direction into a single SortState for robust toggling - formatDate: emit day-first AU date without leading-zero on the day via formatToParts - add bun:test type shim under packages/utils/test to resolve bun:test types for tsc
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. Final state: 13/13 tests pass,
tsc --noEmitclean (exit 0). No test files edited, no dependencies added.Bugs fixed
apps/web/src/lib/api.ts) —useThrottlewas removed from@e2e/utils; the current export isuseDebounce. Updated the consumer import (collapsing duplicate@e2e/utilsimports) and preserved the publicuseSearchDebouncename the app test asserts.packages/ui) — icon-only buttons now passaria-labelthrough to the<button>, exposing an accessible name (WCAG 2.2 SC 4.1.2). Without a label, a dev-onlyconsole.warnfires and a fallback name is applied so the accessible name is never null.packages/ui) — consolidated sort key and direction into a singleSortStateobject updated functionally, making toggle behaviour robust and internally consistent.packages/utils) — emits a day-first Australian date with no leading zero on the day (e.g.1/03/2024,15/06/2024) viaIntl.DateTimeFormat+formatToParts, matching the test expectations.Supporting change
packages/utils/test/bun-types.d.ts— a/// <reference types="bun-types" />shim scoped to the test tree sotscresolvesbun:testfor all four test files. Placed undertest/(notsrc/) so Bun runtime globals do not leak into library/app source. This is a new type-reference file, not a test file.Assumptions
bunfig.toml/setup files are correct; the DOM environment initialises via the repo'stestscript preload (bun run test), the canonical invocation, which passes fully.useThrottle).en-AUpads the day even withday: "numeric", so the day is normalised viaformatToPartswhile the locale still controls field order and separators.Verification
bun run test→ 13 pass, 0 failnpx tsc --noEmit→ exit 0