Skip to content

Commit

Permalink
add placeholder test
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Mar 4, 2025
1 parent 70feb5a commit 6745cd7
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ describe('Send', () => {
// expect(SendAddressSelection).not.toHaveBeenCalled();
});

it('renders a placeholder when wallet has sufficient ETH', () => {
vi.mocked(useSendContext).mockReturnValue({
isInitialized: true,
ethBalance: 0,
} as SendContextType);

render(<Send />);

expect(SendHeader).toHaveBeenCalled();
expect(screen.getByText('This wallet has ETH.')).toBeInTheDocument();

Check failure on line 130 in src/wallet/components/wallet-advanced-send/components/Send.test.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

src/wallet/components/wallet-advanced-send/components/Send.test.tsx > Send > SendDefaultChildren > renders a placeholder when wallet has sufficient ETH

TestingLibraryElementError: Unable to find an element with the text: This wallet has ETH.. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body> <div> <div data-testid="mock-send-provider" > <div class="ock-bg-default ock-border-radius ock-border-line-default border ock-text-foreground h-96 w-88 flex flex-col p-4" data-testid="ockSend" /> </div> </div> </body> ❯ Object.getElementError node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19 ❯ node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38 ❯ node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17 ❯ node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19 ❯ src/wallet/components/wallet-advanced-send/components/Send.test.tsx:130:21
});

// it('renders SendAddressSelection when wallet has sufficient ETH', () => {
// vi.mocked(useSendContext).mockReturnValue({
// isInitialized: true,
Expand Down

0 comments on commit 6745cd7

Please sign in to comment.