fix: resolve 4 cross-package bugs causing test failures#12
Open
stooit wants to merge 1 commit into
Open
Conversation
- Fix renamed hook: export useSearchDebounce from @e2e/utils and fix stale useThrottle import in apps/web/src/lib/api.ts - Fix Button component: spread remaining props (including aria-label) onto the rendered button element - Fix DataTable stale closure: use functional state update in sort handler to avoid capturing stale state - Fix date format: use 'd/MM/yyyy' pattern (no zero-padding on day) - Fix test environment: configure happy-dom preload in root bunfig.toml so UI tests have DOM access when run from repo root
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 (13 tests now pass, 0 fail) and eliminates TypeScript errors.
Bugs Fixed
Renamed hook (
packages/utils→apps/web): TheuseDebouncehook was exported from utils butapps/webimported the old nameuseSearchDebounce. Added auseSearchDebouncere-export alias. Also removed the staleuseThrottleimport that caused a TS2305 error.Button accessibility (
packages/ui): TheButtoncomponent wasn't spreading remaining props onto the DOM element, soaria-label(and other HTML attributes) were silently dropped. Fixed by spreading...restprops.DataTable stale closure (
packages/ui): The sort click handler captured stalesortDirectionstate via closure. Fixed by using a functional state update (prev => ...) pattern.Date format (
packages/utils):formatDateuseddd/MM/yyyy(zero-padded day) but tests expectedd/MM/yyyy(no padding). Fixed the format string.Test environment config: Root
bunfig.tomlneeded apreloadpointing to the happy-dom setup file so that UI tests get a DOM whenbun testis run from the repo root.Assumptions
bun:testTypeScript module resolution warnings are expected (no@types/buninstalled) and not real errors.useSearchDebounceis kept as an alias foruseDebounceto maintain backward compatibility withapps/web.