Skip to content

Commit

Permalink
Merge pull request #711 from dorianvp/detox-zip320
Browse files Browse the repository at this point in the history
Add E2E test for TEX address
  • Loading branch information
juanky201271 authored Sep 26, 2024
2 parents 9b8e3be + 928b9dd commit 6ea9dc1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/Send/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,11 @@ const Send: React.FunctionComponent<SendProps> = ({
/>
)}
</View>
{validAddress === 1 && <FontAwesomeIcon icon={faCheck} color={colors.primary} />}
{validAddress === 1 && (
<View testID="send.address.check">
<FontAwesomeIcon icon={faCheck} color={colors.primary} />
</View>
)}
{validAddress === -1 && <ErrorText>{translate('send.invalidaddress') as string}</ErrorText>}
</View>
<View
Expand Down
33 changes: 33 additions & 0 deletions e2e/send_tex_address.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const { log, device, by, element, expect } = require('detox');

import { loadTestWallet } from './e2e-utils/loadTestWallet.js';

const sleep = ms => new Promise(r => setTimeout(r, ms));

describe('Renders wallet data correctly.', () => {
it('loads a wallet', loadTestWallet);
it('parses the TEX address and correctly renders the confirm screen', async () => {
await waitFor(element(by.id('vt-1')))
.toExist()
.withTimeout(30000);
await element(by.text('SEND')).tap();

// Address taken from the reference implementation
await element(by.id('send.addressplaceholder')).replaceText('tex1s2rt77ggv6q989lr49rkgzmh5slsksa9khdgte');

await waitFor(element(by.id('send.address.check')))
.toExist()
.withTimeout(5000);

await element(by.id('send.amount')).replaceText('0');
await element(by.id('send.scroll-view')).scrollTo('bottom');
await waitFor(element(by.id('send.button')))
.toBeVisible()
.withTimeout(5000);
await element(by.id('send.button')).tap();

await expect(element(by.id('send.confirm.scroll-view'))).toExist();
await expect(element(by.id('send.confirm.scroll-view'))).toBeVisible(20);
await element(by.id('send.confirm.scroll-view')).scrollTo('bottom');
});
});

0 comments on commit 6ea9dc1

Please sign in to comment.