fix: repair cross-package bugs to make all tests pass and clear type errors - #164
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs to make all tests pass and clear type errors#164stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
…e format - apps/web: use renamed useDebounce hook (was useThrottle) re-exported as useSearchDebounce - packages/ui Button: pass aria-label through for accessible name (WCAG 4.1.2) - packages/ui DataTable: fix stale-closure in sort toggle via single atomic state - packages/utils formatDate: day-first AU format without leading zero via formatToParts - 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 (13/13 now pass) and eliminates all TypeScript errors (
tsc --noEmitexit 0) across the monorepo. Four cross-package bugs plus one pre-existing tsconfig gap were addressed. No test files were modified and no dependencies were added.Fixes
apps/web/src/lib/api.ts): the utils hook was renameduseThrottle→useDebounce, butapps/webstill imported the old name. Updated the consumer to importuseDebounceand re-export it asuseSearchDebounce(the public name the test depends on).packages/ui/src/components/Button/Button.tsx): passaria-labelthrough to the rendered<button>so icon-only buttons have an accessible name (WCAG 2.2 SC 4.1.2), with a fallback + dev-only warn when missing.packages/ui/src/components/DataTable/DataTable.tsx): sort handler readsortDirfrom a stale closure; collapsed into one atomicsort: { key, dir }state via a pure functional updater — StrictMode-safe.packages/utils/src/format/date.ts):formatDaterenders day-first without a leading zero (e.g.1/03/2024) usingIntl.formatToPartswithen-AU.tsconfig.json): registeredbun-typessobun:testresolves, clearing 4 pre-existingTS2307errors (config registration;bun-typeswas already a devDependency).Verification
bun run test→ 13 pass / 0 failbunx tsc --noEmit→ exit 0Notes
bun run testscript (applies the happy-dom setup preload; a barebun testmisses it and surfaces spuriousdocument is not definederrors)./^1/date format); implementations follow the tests as written since test files were off-limits.Follow-ups (out of scope)
DataTablesortable<th>is mouse-only (pre-existing WCAG 2.1.1 gap).aria-labelwheniconOnly.