Conversation
- bunfig.toml: replace unrecognised `environment` key with a test preload
so the happy-dom DOM globals register for a bare `bun test`
- Button: apply an aria-label for icon-only buttons with a dev-only warning
when one is omitted (WCAG 2.2 SC 4.1.2)
- formatDate: use explicit numeric en-AU fields via formatToParts to render
unpadded day-first dates ("1/3/2024") while preserving the 4-digit year
- api.ts: useThrottle -> useDebounce at both the import and re-export sites
following the hook rename in @e2e/utils
- tsconfig: add bun-types (fixes `bun:test` resolution) and typecheck
apps/*/test
bun test: 13 pass / 0 fail. tsc --noEmit: clean.
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 and type errors across the monorepo.
bun test→ 13 pass / 0 fail (was 4 pass / 9 fail);tsc --noEmit→ clean (was 5 errors).Bugs spanned all three packages plus test/build config. Only source and config were changed — no test files modified, no dependencies added (
package.json/lockfile untouched).Fixes
bunfig.tomlenvironmentkey with apreloadof the DOM test setupReferenceError: document is not defined— the old key was a silent no-op, so happy-dom never registered for a barebun testpackages/ui/.../Button.tsxaria-labelfor icon-only buttons, with a dev-only warning when omittedpackages/utils/.../date.tsen-AUfields viaformatToPartsformatDatezero-padded the day (01/03/2024); now renders unpadded day-first1/3/2024apps/web/src/lib/api.tsuseThrottle→useDebounceat both import and re-export sites@e2e/utils; the old name was still importedtsconfig.jsonbun-types; includeapps/*/testCannot find module 'bun:test';apps/webtests were never typecheckedAssumptions & notes
dateStyle: "short") also passed the tests, but silently truncated the year to 2 digits (1/3/24) for every consumer of this public formatter — an unrequested behavioural regression.formatToPartsfixes the padding bug the test targets while keeping2024. Verified across multiple timezones.Buttonuses a runtimearia-labelfallback + dev warning rather than making the prop type-required foriconOnly, because a frozen test renders<Button iconOnly />without a label — a type-level requirement would breaktscand require editing a test file, which the task forbids.DataTableleft untouched. ItsBUG:comment about a stale-closure sort toggle no longer describes a real defect — all its tests pass unmodified becausefireEvent.clickflushes between clicks. Worth deleting the stale comment in a follow-up.Suggested follow-ups (non-blocking)
Buttonaccessible name from stringchildren(needs a test-contract change).Buttondev warning into a dedupedwarnOncehelper out of the render body.packages/uiso purepackages/utilstests stay environment-free.