Changeset View
Changeset View
Standalone View
Standalone View
cashtab/src/components/OnBoarding/__tests__/index.test.tsx
| Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | it('We can create a new wallet', async () => { | ||||
| }), | }), | ||||
| ); | ); | ||||
| // We see the backup wallet alert | // We see the backup wallet alert | ||||
| expect( | expect( | ||||
| await screen.findByText('Backup your wallet'), | await screen.findByText('Backup your wallet'), | ||||
| ).toBeInTheDocument(); | ).toBeInTheDocument(); | ||||
| // We see a QR code | // We see a QR code on the Receive page | ||||
| await userEvent.click(screen.getByRole('link', { name: /Receive/ })); | |||||
| expect(screen.getByTitle('Raw QR Code')).toBeInTheDocument(); | expect(screen.getByTitle('Raw QR Code')).toBeInTheDocument(); | ||||
| // New wallet is added in localforage | // New wallet is added in localforage | ||||
| const walletsAfterAdd = await localforage.getItem('wallets'); | const walletsAfterAdd = await localforage.getItem('wallets'); | ||||
| expect(walletsAfterAdd).toHaveLength(1); | expect(walletsAfterAdd).toHaveLength(1); | ||||
| }); | }); | ||||
| it('We can import a wallet', async () => { | it('We can import a wallet', async () => { | ||||
| // localforage defaults | // localforage defaults | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | it('We can import a wallet', async () => { | ||||
| ).not.toBeInTheDocument(), | ).not.toBeInTheDocument(), | ||||
| ); | ); | ||||
| // We see the backup wallet alert | // We see the backup wallet alert | ||||
| expect( | expect( | ||||
| await screen.findByText('Backup your wallet'), | await screen.findByText('Backup your wallet'), | ||||
| ).toBeInTheDocument(); | ).toBeInTheDocument(); | ||||
| // We see a QR code | // We see a QR code on the Receive page | ||||
| await userEvent.click(screen.getByRole('link', { name: /Receive/ })); | |||||
| expect(screen.getByTitle('Raw QR Code')).toBeInTheDocument(); | expect(screen.getByTitle('Raw QR Code')).toBeInTheDocument(); | ||||
| }); | }); | ||||
| }); | }); | ||||