fix: repair cross-package bugs so all tests and typecheck pass - #170
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#170stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import renamed useDebounce from @e2e/utils, re-export as useSearchDebounce (stale useThrottle import removed), collapse dup imports - Button.tsx: apply aria-label to icon-only buttons with trim-aware fallback + dev warning (WCAG 2.2 SC 4.1.2) - date.ts: format en-AU dates day-first without zero-padding the day via formatToParts reassembly - tsconfig.json: add bun-types to compilerOptions.types so bun:test declarations resolve (dependency already installed)
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 monorepo. Before: 8 pass / 5 fail and 5 tsc errors. After: 13 pass / 0 fail and
tsc --noEmitclean (exit 0). No test files were modified and no dependencies were added.Fixes by area
packages/utils→apps/web) —apps/web/src/lib/api.tsimporteduseThrottle, which no longer exists in@e2e/utils(renamed touseDebounce). Updated the import and re-exported it asuseSearchDebounce(the name the test consumes); collapsed duplicate@e2e/utilsimports. Resolves theuseThrottleTS2305 error and bothapi moduletests.packages/ui) —Buttondroppedaria-labelfor icon-only buttons. Now applies it to the rendered element, with a trim-aware fallback + dev-onlyconsole.warnwhen an icon-only button has no usable label (WCAG 2.2 SC 4.1.2). Resolves bothButtonaria-label tests.packages/utils) —formatDatezero-padded the day (01/03/2024); the test requires day-first without leading zero (1/03/2024). Reassemblesen-AUformatToPartsoutput so the day is unpadded while separators/order come from the locale. Resolves theformatDatetest.tsconfig.json) — added"types": ["bun-types"]sobun:testdeclarations resolve.bun-typeswas already an installed devDependency — no new dependency added. Clears the 4 remainingTS2307errors.Verification
bun test packages/utils/test packages/ui/test apps/web/test --preload ./packages/ui/test/setup.ts-> 13 pass / 0 failnpx tsc --noEmit-> zero output, exit 0Notes / assumptions
DataTable"stale closure" test passes as-is — the latent stale-closure bug atDataTable.tsxdoes not manifest under test because React 18'sact()flushes state betweenfireEvent.clickcalls. Per the task's "fix only what tests require," it was left untouched, but it remains a latent bug worth hardening separately (along with the<th onClick>keyboard-operability gap, SC 2.1.1).Buttonfallback label ("Button") is a safety net that satisfies the test'snot.toBeNull()assertion; a compile-time requirement would be a breaking API change and would fail the unmodifiable tests. Deferred as a follow-up.