Skip to content

Commit

Permalink
fix: removing exception trigger test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasonvdb committed Jun 13, 2024
1 parent b15db0f commit 817ffbc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
50 changes: 25 additions & 25 deletions e2e/settings.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,31 +613,31 @@ d('Settings', () => {
});
});

d('Dev Settings', () => {
it('Shows the crash error screen when triggering render error', async () => {
if (checkComplete('settings-dev')) {
return;
}

await element(by.id('Settings')).tap();
if (!__DEV__) {
await element(by.id('DevOptions')).multiTap(5); // enable dev mode
}
await element(by.id('DevSettings')).tap();

// Error screen will not be rendered in development mode
if (__DEV__) {
markComplete('settings-dev');
return;
}

await element(by.id('TriggerRenderError')).tap();
await expect(element(by.id('ErrorClose'))).toBeVisible();
await expect(element(by.id('ErrorReport'))).toBeVisible();

markComplete('settings-dev');
});
});
// d('Dev Settings', () => {
// it('Shows the crash error screen when triggering render error', async () => {
// if (checkComplete('settings-dev')) {
// return;
// }

// await element(by.id('Settings')).tap();
// if (!__DEV__) {
// await element(by.id('DevOptions')).multiTap(5); // enable dev mode
// }
// await element(by.id('DevSettings')).tap();

// // Error screen will not be rendered in development mode
// if (__DEV__) {
// markComplete('settings-dev');
// return;
// }

// await element(by.id('TriggerRenderError')).tap();
// await expect(element(by.id('ErrorClose'))).toBeVisible();
// await expect(element(by.id('ErrorReport'))).toBeVisible();

// markComplete('settings-dev');
// });
// });

d('Support', () => {
it('Can see app status', async () => {
Expand Down
24 changes: 12 additions & 12 deletions src/screens/Settings/DevSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const DevSettings = ({
const dispatch = useAppDispatch();
const { t } = useTranslation('lightning');
const [showDialog, setShowDialog] = useState(false);
const [throwError, setThrowError] = useState(false);
// const [throwError, setThrowError] = useState(false);
const selectedWallet = useAppSelector(selectedWalletSelector);
const selectedNetwork = useAppSelector(selectedNetworkSelector);
const addressType = useAppSelector(addressTypeSelector);
Expand Down Expand Up @@ -162,14 +162,14 @@ const DevSettings = ({
refreshWallet({ selectedWallet, selectedNetwork }).then();
},
},
{
title: 'Trigger exception in React render',
type: EItemType.button,
testID: 'TriggerRenderError',
onPress: (): void => {
setThrowError(true);
},
},
// {
// title: 'Trigger exception in React render',
// type: EItemType.button,
// testID: 'TriggerRenderError',
// onPress: (): void => {
// setThrowError(true);
// },
// },
{
title: 'Trigger exception in action handler',
type: EItemType.button,
Expand Down Expand Up @@ -331,9 +331,9 @@ const DevSettings = ({
},
];

if (throwError) {
throw new Error('test render error');
}
// if (throwError) {
// throw new Error('test render error');
// }

return (
<>
Expand Down

0 comments on commit 817ffbc

Please sign in to comment.