Skip to content

Commit

Permalink
fix: send.test.js tap timing error
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianvp committed Sep 25, 2024
1 parent 7c0d7d0 commit 0b0a8d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ModeEnum, RouteEnums } from './app/AppState';
import { LogBox } from 'react-native';

LogBox.ignoreLogs(['Require cycle: app\\uris\\serverUris.mock.ts -> app\\uris\\serverUris.mock.ts']);
LogBox.ignoreLogs(['[Reanimated] Reduced motion setting is enabled on this device.']);

const advancedTheme: ThemeType = {
dark: true,
Expand Down
2 changes: 1 addition & 1 deletion components/Send/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ const Send: React.FunctionComponent<SendProps> = ({
marginBottom: 20,
}}>
<Button
testID="send.button"
testID={sendButtonEnabled ? 'send.button' : 'send.button-disabled'}
accessible={true}
accessibilityLabel={'title ' + translate('send.button')}
type={ButtonTypeEnum.Primary}
Expand Down
22 changes: 12 additions & 10 deletions e2e/send.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { log, device, by, element } = require('detox');
const { log, device, by, element, expect } = require('detox');

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

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

describe('Renders wallet data correctly.', () => {
// i just pulled this seed out of thin air
Expand All @@ -11,32 +11,34 @@ describe('Renders wallet data correctly.', () => {
//await sleep(4000);

await element(by.text('SEND')).tap();

await element(by.id('send.scan-button')).tap();
await expect(element(by.id('scan.cancel'))).toBeVisible();
await element(by.id('scan.cancel')).tap();
});

it('adds return address to the memo if that option is selected, and correctly renders confirm screen', async () => {

await element(by.id('send.addressplaceholder')).replaceText(
'u1lx7nlnqqqs7p4hcqz4hyjgnw7h8zskcgr2f8dfhm96np0gnfdzu7jtms7q2pxd7ufy96wxzdsdy65jvp3td7fj2ltcz0jpak86ddyszl9ykn5s86q3xataya5867z3tj2x8cw0ljyrenymr2gcqmjf50gmexqj233yn3kdaxn2yukwcx87emurufakf82wapgnu5h3fvae6aw9uus2r',
);
await element(by.id('send.amount')).replaceText('0');
await element(by.id('send.checkboxUA')).tap();
await element(by.id('send.checkboxua')).tap();
await element(by.id('send.scroll-view')).scrollTo('bottom');
await element(by.id('send.memo-field')).replaceText("1\n2\n3\n4\n5\n6\n7\n8");
await element(by.id('send.memo-field')).replaceText('1\n2\n3\n4\n5\n6\n7\n8');
await element(by.id('send.scroll-view')).scrollTo('bottom');

await waitFor(element(by.id('send.button'))).toBeVisible();
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');

const memo = element(by.id('send.confirm-memo'));

await expect(memo).toBeVisible(100);
await expect(memo).toHaveText(
'1\n2\n3\n4\n5\n6\n7\n8\nReply to: \nu1lx7nlnqqqs7p4hcqz4hyjgnw7h8zskcgr2f8dfhm96np0gnfdzu7jtms7q2pxd7ufy96wxzdsdy65jvp3td7fj2ltcz0jpak86ddyszl9ykn5s86q3xataya5867z3tj2x8cw0ljyrenymr2gcqmjf50gmexqj233yn3kdaxn2yukwcx87emurufakf82wapgnu5h3fvae6aw9uus2r',
);
});

});

0 comments on commit 0b0a8d4

Please sign in to comment.