Changeset View
Changeset View
Standalone View
Standalone View
cashtab/src/components/Configure/__tests__/Configure.test.tsx
| Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | it('Setting "Send Confirmations" settings will show send confirmations', async () => { | ||||
| <ConfigureTestWrapper | <ConfigureTestWrapper | ||||
| chronik={mockedChronik} | chronik={mockedChronik} | ||||
| agora={mockAgora} | agora={mockAgora} | ||||
| ecc={ecc} | ecc={ecc} | ||||
| theme={theme} | theme={theme} | ||||
| />, | />, | ||||
| ); | ); | ||||
| // Default route is home | // Default route is /configure, we are already on Settings screen | ||||
| await waitFor(() => | await waitFor(() => | ||||
| expect( | expect( | ||||
| screen.queryByTitle('Cashtab Loading'), | screen.queryByTitle('Cashtab Loading'), | ||||
| ).not.toBeInTheDocument(), | ).not.toBeInTheDocument(), | ||||
| ); | ); | ||||
| // Click the hamburger menu | expect(screen.getByText('Display Currency')).toBeInTheDocument(); | ||||
| await user.click(screen.queryByTitle('Show Other Screens')!); | |||||
| // Navigate to Settings screen | |||||
| await user.click( | |||||
| screen.getByRole('button', { | |||||
| name: /Settings/i, | |||||
| }), | |||||
| ); | |||||
| // Now we see the Settings screen | |||||
| expect(screen.getByTitle('Settings')).toBeInTheDocument(); | |||||
| // Send confirmations are disabled by default | // Send confirmations are disabled by default - enable via SegmentedControl | ||||
| await user.click(screen.getByRole('button', { name: 'On' })); | |||||
| // Enable send confirmations | // Navigate to the Send screen via footer nav | ||||
| await user.click(screen.getByTitle('Toggle Send Confirmations')); | |||||
| // Navigate to the Send screen | |||||
| await user.click( | await user.click( | ||||
| screen.getByRole('button', { | screen.getByRole('button', { | ||||
| name: /Send Screen/i, | name: 'Send Screen', | ||||
| }), | }), | ||||
| ); | ); | ||||
| // Now we see the Send screen | // Now we see the Send screen | ||||
| expect(screen.getByTitle('Toggle Multisend')).toBeInTheDocument(); | expect( | ||||
| await screen.findByPlaceholderText('Address'), | |||||
| ).toBeInTheDocument(); | |||||
| // Fill out to and amount | // Fill out to and amount | ||||
| await user.type( | await user.type( | ||||
| screen.getByPlaceholderText('Address'), | screen.getByPlaceholderText('Address'), | ||||
| 'ecash:qphlhe78677sz227k83hrh542qeehh8el5lcjwk72y', | 'ecash:qphlhe78677sz227k83hrh542qeehh8el5lcjwk72y', | ||||
| ); | ); | ||||
| await user.type(screen.getByPlaceholderText('Amount'), '55'); | await user.type(screen.getByPlaceholderText('Amount'), '55'); | ||||
| // click send | // click send | ||||
| ▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | it('"ABSOLUTE MINIMUM fees" setting is unavailable if wallet holds 0.01 less than required balance of Cachet', async () => { | ||||
| await user.click( | await user.click( | ||||
| screen.getByRole('button', { | screen.getByRole('button', { | ||||
| name: /Settings/i, | name: /Settings/i, | ||||
| }), | }), | ||||
| ); | ); | ||||
| // Now we see the Settings screen | // Now we see the Settings screen | ||||
| expect(screen.getByTitle('Settings')).toBeInTheDocument(); | expect(screen.getByText('Display Currency')).toBeInTheDocument(); | ||||
| // We DO NOT see VIP settings | // We DO NOT see VIP settings | ||||
| expect(screen.queryByText('VIP Settings')).not.toBeInTheDocument(); | expect(screen.queryByText('VIP Settings')).not.toBeInTheDocument(); | ||||
| // We DO NOT see the CACHET token icon | // We DO NOT see the CACHET token icon | ||||
| expect( | expect( | ||||
| screen.queryByAltText( | screen.queryByAltText( | ||||
| `icon for ${appConfig.vipTokens.cachet.tokenId}`, | `icon for ${appConfig.vipTokens.cachet.tokenId}`, | ||||
| ▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | it('VIP users see VIP status message', async () => { | ||||
| await user.click( | await user.click( | ||||
| screen.getByRole('button', { | screen.getByRole('button', { | ||||
| name: /Settings/i, | name: /Settings/i, | ||||
| }), | }), | ||||
| ); | ); | ||||
| // Now we see the Settings screen | // Now we see the Settings screen | ||||
| expect(screen.getByTitle('Settings')).toBeInTheDocument(); | expect(screen.getByText('Display Currency')).toBeInTheDocument(); | ||||
| // We see VIP status | // We see VIP status | ||||
| expect(screen.getByText('Cashtab VIP 🏆')).toBeInTheDocument(); | expect(screen.getByText('Cashtab VIP 🏆')).toBeInTheDocument(); | ||||
| // We see the CACHET token icon | // We see the CACHET token icon | ||||
| expect( | expect( | ||||
| screen.getByAltText( | screen.getByAltText( | ||||
| `icon for ${appConfig.vipTokens.cachet.tokenId}`, | `icon for ${appConfig.vipTokens.cachet.tokenId}`, | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines | |||||