fix: repair cross-package bugs so all tests and typecheck pass - #113
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#113stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import the real hook export (useDebounce) and re-export as useSearchDebounce, fixing the renamed-hook import mismatch - Button: forward aria-label for accessible name (WCAG 2.2 SC 4.1.2), with dev-time warning + fallback for icon-only buttons - formatDate: strip zero-pad on day so en-AU output is day-first (1/03/2024) - bunfig.toml: preload happy-dom setup so document is defined for root bun test - tsconfig: register 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 --noEmitfrom the repo root now exits 0: 13/13 tests pass, zero type errors (was 4 pass / 9 fail, 5 type errors).No test files were modified and no dependencies were added — only source and config.
Fixes
apps/web/src/lib/api.tsuseDebouncefrom@e2e/utilsand re-exported it asuseSearchDebounce(the name the test asserts).packages/ui/src/components/Button/Button.tsxaria-labelto give icon-only buttons an accessible name (WCAG 2.2 SC 4.1.2), with a dev-time warning + fallback when omitted.packages/utils/src/format/date.tsen-AUoutput is day-first (1 March 2024->1/03/2024), matching the "day 1 not confused with month 1" test.bunfig.tomlpreload = ["./packages/ui/test/setup.ts"]so happy-dom registersdocumentwhenbun testis run directly from the repo root.bun:testtypestsconfig.jsonbun-typessoimport ... from "bun:test"resolves (cleared 4Cannot find moduleerrors).Assumptions / Notes
fireEvent.clickis a separate render, so the sort handler already closes over fresh state; the test passes withDataTable.tsxunmodified, so it was left untouched.not.toBeNull()assertion while flagging the missing label in development. Enforcing a requiredaria-labelat the type level would change the public API and break the existing test, so it was not done here.