test: add comprehensive unit tests for frontend hooks (Closes #534) - #591
Open
waterWang wants to merge 1 commit into
Open
test: add comprehensive unit tests for frontend hooks (Closes #534)#591waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…l-Guild#534) Add unit tests for 5 custom hooks: - useWallet: context value, connect/disconnect, signTransaction, isConnecting state - useAutosave: localStorage save, debounce, clearSavedData, loadSavedData, error handling - useFeeEstimation: React Query hook, fee recommendation, batch estimation, error state - useEmployeePortal: data loading, pagination, filtering by status/type, search, currency change - useWithdrawal: anchor selection, amount validation, initiation, polling, cancel, reset Test infrastructure: vitest config, test setup with jest-dom matchers and i18n mock. 48 tests total, all passing.
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
Add comprehensive unit tests for 5 frontend hooks using vitest and @testing-library/react.
Hooks covered
Test infrastructure
vitest.config.ts— jsdom environment, globals, test setupsetup.ts— jest-dom matchers, react-i18next mock, cleanup on afterEachTotal: 48 tests, all passing.