fix: repair failing tests and type errors across monorepo - #100
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: rename stale useThrottle import to useDebounce in apps/web api - ui/Button: add aria-label for iconOnly (WCAG 2.2 SC 4.1.2) - ui/DataTable: fix stale-closure in sort toggle via updater form - utils/date: use formatToParts for correct non-padded day locale output - test env: preload DOM setup in bunfig.toml; add bun-types to tsconfig
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 so
bun test && tsc --noEmitpasses cleanly (13 pass / 0 fail, tsc exit 0; baseline was 4 pass / 9 fail with 6 type errors). Bugs spanned all three packages.Fixes
apps/web/src/lib/api.ts— theuseThrottlehook was renamed inpackages/utils(nowuseDebounce); updated the stale import and usage. (ResolvesTS2305: Module '@e2e/utils' has no exported member 'useThrottle'.)packages/ui/src/components/Button/Button.tsx— added the requiredaria-labelforiconOnlybuttons (WCAG 2.2 SC 4.1.2), asserted by the Button test.packages/ui/src/components/DataTable/DataTable.tsx— fixed a stale-closure bug in the sort toggle (functional state updater) so "sorts descending on second click" passes under controlled re-render.packages/utils/src/format/date.ts— corrected date formatting to produce a non-padded day so2024-03-01renders as1/03/2024.Test-environment / config fixes (no test files modified, no deps added)
bunfig.toml— replaced an inertenvironmentsetting with apreloadof the existing DOM setup script, resolvingReferenceError: document is not definedfrom@testing-library/react'srender().tsconfig.json— addedbun-typestocompilerOptions.types(already innode_modules) to resolveCannot find module 'bun:test'.Constraints honoured
Assumptions
bunfig.tomlpreload of the pre-existing UI test setup script is the intended DOM wiring.useDebounceis the correct, signature-compatible replacement for the renameduseThrottleat theapi.tscall site.