fix: repair cross-package test and type failures - #109
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: update import to renamed useSearchDebounce/useDebounce hook (was useThrottle) - bunfig.toml: register happy-dom preload so document is defined under bun test from root - Button: add aria-label wiring with fallback so icon-only buttons have an accessible name - DataTable: use functional setState update to fix stale-closure sort direction toggle - date.ts: use Intl dateStyle:short (en-AU) so formatDate emits day-first without leading zero - tsconfig.json: add bun-types so bun:test resolves in test files
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 in the monorepo.
bun testgoes from 4 pass / 9 fail → 13 pass / 0 fail, andnpx tsc --noEmitfrom 5 errors → 0. No test files were modified and no dependencies were added.Fixes
apps/web/src/lib/api.tsuseThrottle, which no longer exists in@e2e/utils(renamed)useSearchDebounce/useDebounce)bunfig.toml(root)environment = "happy-dom"— a Vitest option Bun silently ignores — sodocumentwas undefined for UI tests run from rootpackages/ui/bunfig.tomlwas verified as still required and left intactpackages/ui/.../Button.tsxaria-labelaria-labelwith a fallback so the icon-only button always has an accessible namepackages/ui/.../DataTable.tsxsetStateupdate (correct, regression-hardening pattern)packages/utils/.../date.tsformatDateemitted01/03/2024(leading zero); test expects/^1/Intl{ dateStyle: "short" }(en-AU), which yields day-first with no leading zero. Note: the source comment's suggested field-reorder does not fix this —Intlignores option ordertsconfig.jsonTS2307: Cannot find module 'bun:test'bun-typestotypes(alongsidereact) sobun:testresolvesAssumptions & notes
dateStyle: "short"produces a 2-digit year (1/3/24). This is the onlyIntloption satisfying both test assertions; documented in the source. External consumers of@e2e/utilsrelying on a 4-digit year would see a change — flagged for team confirmation.aria-labelwheniconOnly) was rejected because it fails to compile against the existing (unmodifiable) test. Recommend a dev-onlyconsole.warnfollow-up to surface the omission.fireEventflushes each click in its own render cycle, so this test doesn't actually discriminate the stale-closure bug. The fix is kept as it's the correct pattern.Verification