test: add demo page smoke tests (Tier 5)#419
Merged
gabitoesmiapodo merged 3 commits intotest/utilsfrom Mar 25, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Tier 5 smoke tests to ensure the home page, 404 page, and several demo components render without crashing by mocking Web3/wagmi dependencies at the module level.
Changes:
- Added smoke test for the Home page rendering its main sections.
- Added smoke tests for multiple demo components (ConnectWallet, EnsName, HashHandling, SignMessage, SwitchNetwork, TransactionButton, TokenDropdown, TokenInput).
- Added smoke test for the NotFound404 page.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/components/pageComponents/home/index.test.tsx | Smoke test that Home renders Welcome + Examples (mocked). |
| src/components/pageComponents/home/Examples/demos/TransactionButton/index.test.tsx | Smoke test for TransactionButton demo with Web3 status + ConnectWalletButton mocked. |
| src/components/pageComponents/home/Examples/demos/TokenInput/index.test.tsx | Smoke test for TokenInput demo using QueryClientProvider and mocked token hooks. |
| src/components/pageComponents/home/Examples/demos/TokenDropdown/index.test.tsx | Smoke test for TokenDropdown demo with shared TokenDropdown mocked. |
| src/components/pageComponents/home/Examples/demos/SwitchNetwork/index.test.tsx | Smoke test for SwitchNetwork demo showing Connect Wallet fallback. |
| src/components/pageComponents/home/Examples/demos/SignMessage/index.test.tsx | Smoke test for SignMessage demo showing Connect Wallet fallback. |
| src/components/pageComponents/home/Examples/demos/HashHandling/index.test.tsx | Smoke test for HashHandling demo with hash detection mocked. |
| src/components/pageComponents/home/Examples/demos/EnsName/index.test.tsx | Smoke test for EnsName demo with wagmi useEnsName mocked. |
| src/components/pageComponents/home/Examples/demos/ConnectWallet/index.test.tsx | Smoke test for ConnectWallet demo with ConnectWalletButton mocked. |
| src/components/pageComponents/NotFound404.test.tsx | Smoke test for NotFound404 rendering title and Home button with router navigation mocked. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/components/pageComponents/home/Examples/demos/HashHandling/index.test.tsx
Outdated
Show resolved
Hide resolved
2ecd9f4 to
b65a318
Compare
88ed222 to
27b5511
Compare
b65a318 to
03b8d50
Compare
27b5511 to
5d4e886
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/components/pageComponents/home/Examples/demos/TransactionButton/index.test.tsx
Show resolved
Hide resolved
src/components/pageComponents/home/Examples/demos/TokenInput/index.test.tsx
Show resolved
Hide resolved
03b8d50 to
82f2f21
Compare
5d4e886 to
5c9aa29
Compare
628a91a to
7b00d3b
Compare
Smoke tests for all demo page components to verify they render without crashing. Mocks external Web3 deps at module level. New test files: - home/index.test.tsx: Home renders Welcome + Examples sections - NotFound404.test.tsx: 404 page with mocked useNavigate - demos/ConnectWallet/index.test.tsx: mocked ConnectWalletButton - demos/EnsName/index.test.tsx: mocked useEnsName - demos/HashHandling/index.test.tsx: mocked useWeb3Status + detectHash - demos/SignMessage/index.test.tsx: shows fallback when wallet absent - demos/SwitchNetwork/index.test.tsx: shows fallback when wallet absent - demos/TransactionButton/index.test.tsx: shows fallback when wallet absent - demos/TokenDropdown/index.test.tsx: mocked BaseTokenDropdown - demos/TokenInput/index.test.tsx: mocked useTokenLists + useTokenSearch Also adds .env.test and src/test-utils.tsx (shared test utilities).
The module exports detectHash as a default export; the mock only provided a named export so HashInput would receive undefined and throw on invocation. Added both default and named exports to the mock factory.
- home/index.test.tsx: use renderWithProviders from test-utils - TransactionButton demo: use createMockWeb3Status for complete hook shape - TokenInput demo: fix useTokenInput mock to match the real hook return (amount/setAmount/amountError/balance/isLoadingBalance/selectedToken/setTokenSelected) and use renderWithProviders + createMockWeb3Status helpers
657ada0 to
b0fe779
Compare
fernandomg
approved these changes
Mar 25, 2026
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
Test plan
pnpm testpasses on this branchwithSuspenseAndRetrywrapped inQueryClientProviderin test setup