From 817ffbcb81b7e2f0c4c94d7789f51eb4713e1d6a Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 13 Jun 2024 10:29:35 +0200 Subject: [PATCH] fix: removing exception trigger test --- e2e/settings.e2e.js | 50 +++++++++++----------- src/screens/Settings/DevSettings/index.tsx | 24 +++++------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/e2e/settings.e2e.js b/e2e/settings.e2e.js index f89ac51f9..a903389e3 100644 --- a/e2e/settings.e2e.js +++ b/e2e/settings.e2e.js @@ -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 () => { diff --git a/src/screens/Settings/DevSettings/index.tsx b/src/screens/Settings/DevSettings/index.tsx index ae0cf59a4..931a1fb1b 100644 --- a/src/screens/Settings/DevSettings/index.tsx +++ b/src/screens/Settings/DevSettings/index.tsx @@ -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); @@ -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, @@ -331,9 +331,9 @@ const DevSettings = ({ }, ]; - if (throwError) { - throw new Error('test render error'); - } + // if (throwError) { + // throw new Error('test render error'); + // } return ( <>