fix: resolve 4 cross-package bugs causing test failures#25
Open
stooit wants to merge 1 commit into
Open
Conversation
- Fix renamed hook import: useThrottle → useDebounce in apps/web/src/lib/api.ts - Fix date format: use non-padded day (d/MM/yyyy) in packages/utils/src/format/date.ts - Fix Button accessibility: pass ariaLabel prop as aria-label attribute - Fix DataTable stale closure: use functional state update in sort handler - Fix test environment: add happy-dom preload to root bunfig.toml for UI tests
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 across the monorepo by resolving 4 cross-package bugs:
apps/web/src/lib/api.ts): Updated import fromuseThrottletouseDebounceand re-exported asuseSearchDebounceto match the expected APIpackages/utils/src/format/date.ts): Changed day format from zero-paddedddto non-paddeddso output is1/03/2024not01/03/2024packages/ui/src/components/Button/Button.tsx): PassedariaLabelprop through asaria-labelHTML attribute for icon-only buttonspackages/ui/src/components/DataTable/DataTable.tsx): Used functional state update in sort handler to avoid capturing stale statebunfig.toml): Added happy-dom preload to root bunfig.toml so UI tests run with a DOM environment whenbun testis invoked from the repo rootVerification
All 13 tests pass, 0 failures. TypeScript type-check clean (only expected
bun:testmodule resolution warnings).Assumptions
bun:testmodule resolution errors intsc --noEmitare expected and acceptable (bun:test is a runtime-only module)