fix: repair cross-package test failures and type errors#77
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: re-export renamed hook (useDebounce) under public name useSearchDebounce - date.ts: use en-AU day-first short date format - Button.tsx: pass aria-label through to button (icon-only fallback) - DataTable.tsx: fix stale-closure in sort toggle via functional setState - tsconfig.json: add bun-types so bun:test resolves under tsc - bunfig.toml: load happy-dom setup preload so document is defined under bare 'bun test'
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.
bun testnow reports 13/13 pass andtsc --noEmitis clean. No test files were modified and no dependencies were added.Bugs fixed
apps/web/src/lib/api.ts) —useThrottleno longer exists in@e2e/utils; the hook isuseDebounce. Updated the import and the re-export, preserving the public nameuseSearchDebouncethatapi.test.tsasserts.packages/utils/src/format/date.ts) — switched toIntl.DateTimeFormat('en-AU', { dateStyle: 'short' })so dates render day-first with no leading zero on the day (e.g.1/03/2024), satisfyingdate.test.ts.packages/ui/src/components/Button/Button.tsx) — thearia-labelprop was accepted but never applied to the rendered<button>. Now passed through, with a non-null fallback for icon-only buttons.packages/ui/src/components/DataTable/DataTable.tsx) — the sort-direction toggle read stale state; changed to the functionalsetSortDir(prev => ...)form so a second click correctly sorts descending.Test infrastructure
tsconfig.json— added"types": ["bun-types"]sobun:testimports resolve undertsc --noEmit(bun-types was already installed).bunfig.toml(root) — addedpreload = ["./packages/ui/test/setup.ts"]so a barebun testfrom the repo root registers happy-dom globals. Previouslydocumentwas only defined when running thepackage.jsontestscript (which passes--preloadexplicitly); a barebun testleftdocumentundefined and broke the React component tests.packages/ui/bunfig.toml— added theenvironment = \"happy-dom\"key it was missing.Assumptions
setup.tsis a test setup helper (not a test case), so referencing it from the root bunfig is in scope; its contents were not changed.Verification
bun test && tsc --noEmit→ 13 pass / 0 fail, tsc clean. Independently reviewed for minimal, non-masking fixes.