fix: resolve failing tests and type errors across monorepo#56
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: use renamed useDebounce hook (was useThrottle) from @e2e/utils - date.ts: use en-AU short dateStyle for day-first, non-padded formatting - Button.tsx: always wire aria-label so icon-only buttons are accessible - DataTable.tsx: fix stale-closure sort toggle via functional state updater - tsconfig.json: add bun-types so tsc resolves bun:test globals
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 5 failing tests and the 1 outstanding
tsc --noEmiterror across the monorepo. The bugs spanned package boundaries (packages/utils→apps/web) as well as in-component logic and accessibility/formatting concerns.Final state:
bun run test→ 13/13 pass ·npx tsc --noEmit→ 0 errors.Fixes
apps/web/src/lib/api.tsuseThrottle, which@e2e/utilsno longer exports (hook was renamed touseDebounce) — caused TS2305 + 2 failingapi moduletestsuseDebounceand re-export it asuseSearchDebouncepackages/utils/src/format/date.ts01/03/2024); test expects non-padded en-AU style (1/03/2024)packages/ui/src/components/Button/Button.tsxaria-labelnot wired througharia-labelso icon-only buttons expose an accessible namepackages/ui/src/components/DataTable/DataTable.tsxtsconfig.jsontsccould not resolve thebun:testmodule in test filesbun-typesto compilertypes(resolution only — no loosening of strictness)Constraints honoured
Verification
bun run test(13/13 pass, exit 0) andnpx tsc --noEmit(0 errors, exit 0) after the changes.tsconfig.jsonchange confirmed to be a minimal resolution fix that does not weaken type safety.Assumptions
useDebounce(inferred from the utils export surface and theuseSearchDebouncere-export the test asserts).formatDatetest expecting/^1/for 1 March 2024.