Skip to content

Commit

Permalink
πŸ–οΈ. e2e update (#1768)
Browse files Browse the repository at this point in the history
* check for applied

* clean

* revert

* clean

* fix function

* update ganache

* lint

* clean

* no-unused-vars
  • Loading branch information
skylarbarrera authored Feb 24, 2021
1 parent c50deb3 commit 9fca3a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions e2e/ganacheTransactionFlow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ describe('Ganache Transaction Flow', () => {
await Helpers.checkIfVisible('developer-settings-modal');
});

if (device.getPlatform() === 'ios') {
it('Should show Applied alert after pressing Alert', async () => {
await Helpers.tap('alert-section');
await Helpers.delay(5000);
await Helpers.checkIfElementByTextIsVisible('APPLIED');
await Helpers.delay(1000);
await Helpers.tapAlertWithButton('OK');
await Helpers.checkIfVisible('developer-settings-modal');
await Helpers.delay(2000);
});
}

it('Should show Ganache Toast after pressing Connect To Ganache', async () => {
await Helpers.tap('ganache-section');
await Helpers.delay(10000);
Expand Down
14 changes: 14 additions & 0 deletions src/components/settings-menu/DevSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ const DevSection = () => {
navigate(Routes.PROFILE_SCREEN);
}, [navigate]);

const checkAlert = useCallback(async () => {
try {
const request = await fetch(
'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest'
);
// eslint-disable-next-line no-unused-vars
const response = request.json();
Alert.alert('Status', 'NOT APPLIED');
} catch (e) {
Alert.alert('Status', 'APPLIED');
}
}, []);

const removeBackups = async () => {
const newWallets = { ...wallets };
Object.keys(newWallets).forEach(key => {
Expand Down Expand Up @@ -86,6 +99,7 @@ const DevSection = () => {
onPress={connectToGanache}
testID="ganache-section"
/>
<ListItem label="β€πŸ–οΈ Alert" onPress={checkAlert} testID="alert-section" />
<ListFooter />

{Object.keys(config)
Expand Down

0 comments on commit 9fca3a9

Please sign in to comment.