fix: repair cross-package bugs and test environment#45
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook useDebounce (was useThrottle) - date.ts: use en-AU dateStyle short for day-first formatting - bunfig.toml: preload happy-dom setup so DOM globals register from root - Button.tsx: forward aria-label to button element - DataTable.tsx: use functional updater for sort direction (stale closure) - tsconfig.json: add bun-types so bun:test resolves
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 test && tsc --noEmitnow fully green: 13 pass, 0 fail, 0 type errors). Bugs spanned all three packages plus shared config.Changes
apps/web/src/lib/api.ts@e2e/utils(useThrottle→useDebounce); updated the import and theuseSearchDebouncere-export alias. Resolves the missing-export runtime + TS2305 errors.packages/utils/src/format/date.tsformatDateused explicit{month,day,year:"numeric"}which rendered month-first (01/03/2024). Switched toen-AU{ dateStyle: "short" }for day-first, no-leading-zero output (1/03/2024).bunfig.toml(root)[test]declaredenvironment = "happy-dom"but had no preload, so DOM globals weren't registered when running from the repo root (document is not defined). Addedpreload = ["./packages/ui/test/setup.ts"](the existing happy-dom registrator).packages/ui/src/components/Button/Button.tsxaria-labelprop was destructured but never forwarded; addedaria-label={ariaLabel}to the element so the accessible name is set.packages/ui/src/components/DataTable/DataTable.tsxsetSortDir(sortDir === ...)with the functional updatersetSortDir(prev => ...).tsconfig.json(root)"types": ["bun-types"]sobun:testresolves undertsc --noEmit.Assumptions
bunfig.toml, no test files were touched.en-AUdateStyle: "short"is the intended locale/format per the date test's day-first, no-leading-zero expectation.Verification
bun test→ 13 pass / 0 failnpx tsc --noEmit→ exit 0