fix: resolve cross-package test failures and type errors#43
Open
stooit wants to merge 1 commit into
Open
Conversation
- utils: re-export renamed useDebounce hook as useSearchDebounce for consumers - utils: formatDate now uses unpadded day (d/MM/yyyy), e.g. 1/03/2024 - ui: Button forwards aria-label to the underlying <button> (WCAG 4.1.2) - ui: DataTable sort toggle uses functional setState to fix stale closure - tsconfig: add bun-types to compilerOptions.types to resolve bun:test typings
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 clears all
tsc --noEmiterrors across the monorepo (packages/ui,packages/utils,apps/web). Each fix targets the root-cause source bug; no test files were modified and no dependencies were added.Gate status
bun run test→ 13 pass, 0 fail (5 files)tsc --noEmit→ 0 errors (exit 0)Fixes
packages/utilsuseSearchDebouncewhich was no longer exported (SyntaxError)useSearchDebouncename from@e2e/utils; updated theapps/web/src/lib/api.tsimport site to matchpackages/utilsformatDatereturned01/03/2024(zero-padded day); test expects1/03/2024d/MM/yyyy, en-AU style)packages/uiButtondid not forwardaria-labelto the rendered<button>(WCAG 4.1.2)aria-label(and rest a11y props) onto the underlying button elementpackages/uiDataTablestale-closure bug caught by a controlled re-render testtsconfig.jsonCannot find module 'bun:test'type errors in test filesbun-typestocompilerOptions.types(config only — already-installed types, no new dependency, no test files touched)Verification
reviewagent: APPROVE — fixes confirmed correct, minimal, root-cause (not test-masking), with no regressions to other call sites.Assumptions
bun run test(the configured script that preloads the happy-dom registrar); plainbun testskips the preload and cannot mount React components.bun:testtsc errors pre-existed on the base commit and appear only in test files; resolved them via thetsconfigtypesentry rather than editing the forbidden test files.useSearchDebouncewas treated as the canonical exported name because the test asserts that export exists.