fix: repair failing tests and type errors across monorepo - #151
Open
stooit wants to merge 1 commit into
Open
Conversation
…oggle - api.ts: import/re-export useDebounce (was stale useThrottle after rename) - date.ts: use dateStyle 'short' for en-AU so day is unpadded (D/M/YY) - Button: apply aria-label for icon-only buttons (WCAG 2.2 SC 4.1.2), with dev-only warning + fallback label when omitted - DataTable: use functional setState to fix stale-closure sort toggle - bunfig.toml: preload happy-dom setup at root so document is defined for UI tests under a root `bun test` run (Bun has no `environment` option) - tsconfig.json: add bun-types so `bun:test` module resolves All 13 tests pass; tsc --noEmit is clean. No test files modified.
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 multi-package monorepo. After these changes
bun test && tsc --noEmitpasses cleanly from the repo root (13 pass / 0 fail, tsc exit 0). No test files were modified and no dependencies were added.Bugs fixed
apps/web/src/lib/api.tsuseThrottle, renamed touseDebouncein@e2e/utils(TS error + runtime crash)useDebounce;useSearchDebouncealias preservedpackages/utils/src/format/date.tsformatDateemitted a zero-padded day (01/03/2024); test expects unpadded (/^1/)dateStyle: 'short'withen-AU→1/3/24packages/ui/src/components/Button/Button.tsxaria-labeldestructured but never applied — icon-only buttons had no accessible name (WCAG 2.2 SC 4.1.2)aria-label; dev-only warning + fallback label when omittedpackages/ui/src/components/DataTable/DataTable.tsxsetSortDir(prev => ...)bunfig.tomldocument is not definedunder a rootbun testrunsetup.tsat the root bunfigtsconfig.jsonCannot find module 'bun:test'—bun-typesnot auto-included"types": ["bun-types"]Notes / assumptions
environmentconfig option (Vitest concept) — the root bunfig'senvironment = "happy-dom"was inert. DOM comes solely fromGlobalRegistratorinpackages/ui/test/setup.ts, and Bun uses the bunfig nearest the cwd, so a root run never loaded the package-scoped preload. Fix: add the preload to the root bunfig.setup.ts(a test file) was not edited.en-AUalready orders day-first, butnumericfields always zero-pad. OnlydateStyle: 'short'yields an unpadded day. This produces a 2-digit year (24); the test asserts nothing about the year.aria-labelto still expose a non-null accessible name, hence the fallback + dev warning.Verification
No files under any
test/directory were modified.