Conversation
…nd test config - api.ts: import renamed useDebounce hook from @e2e/utils (was stale useThrottle) - formatDate: strip en-AU day zero-padding via formatToParts (1/03/2024 not 01/03/2024) - Button: bind aria-label for icon-only buttons with dev warning [WCAG 4.1.2] - DataTable: use functional setState for sort toggle (harden against stale closure) - bunfig.toml: register happy-dom via preload (test.environment is not a Bun key) - tsconfig.json: add bun-types for bun:test module resolution
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 9 failing tests and 5 type errors in the monorepo. Suite now reports 13 pass / 0 fail and
tsc --noEmitis clean.Root causes & fixes
apps/web/src/lib/api.ts— imported a stale hook nameuseThrottlefrom@e2e/utils; the hook was renamed touseDebounce. Updated the import and re-export. (useSearchDebouncehas no call sites, so no behavioural change.)packages/utils/src/format/date.ts—formatDateproduced01/03/2024(zero-padded day) under en-AU; the test requires1/03/2024. Switched toIntl.DateTimeFormat.formatToPartsand stripped the day's leading zero. Month stays padded, year stays 4-digit;formatDateTime/formatAUDunaffected.packages/ui/src/components/Button/Button.tsx— icon-only buttons rendered with no accessible name (WCAG 2.2 SC 4.1.2). Now bindaria-label, falling back to string children, plus a dev-onlyconsole.warnwhen an icon-only button lacks a label.packages/ui/src/components/DataTable/DataTable.tsx— sort toggle changed to a functionalsetStateupdate to harden against stale-closure/batched-update issues.Test-config fixes (no source-behaviour impact)
bunfig.toml—environment = "happy-dom"is not a recognised Bun[test]key and was silently inert; replaced with apreloadregistering the happy-dom setup sobun testprovides a DOM standalone. This unblocked thedocument is not definederrors.tsconfig.json— addedbun-typestocompilerOptions.typesto resolve thebun:testmodule (fixed 4x TS2307).Constraints honoured
git diff --name-only).bun-typesand@happy-dom/global-registratorused;package.json/lockfile untouched.Verification
Reviewer notes / assumptions
aria-labelfallback to a generic label is required byButton.test.tsx(asserts the attribute is non-null even when no label is passed). A stricter approach would fail that test, so the devconsole.warnsurfaces the misuse instead.bun-types: "latest"unpinned).