Skip to content

Commit 3023daf

Browse files
test: adds mocks and tries a different locator for 5
1 parent 311e070 commit 3023daf

File tree

6 files changed

+535
-16
lines changed

6 files changed

+535
-16
lines changed

app/components/Views/Root/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
1313
import { RootProps } from './types';
1414
import NavigationProvider from '../../Nav/NavigationProvider';
1515
import ControllersGate from '../../Nav/ControllersGate';
16-
import { isTest , isE2E } from '../../../util/test/utils';
16+
import { isTest, isE2E } from '../../../util/test/utils';
1717
import FontLoadingGate from './FontLoadingGate';
1818
import { FeatureFlagOverrideProvider } from '../../../contexts/FeatureFlagOverrideContext';
1919
///: BEGIN:ONLY_INCLUDE_IF(preinstalled-snaps,external-snaps)

app/components/Views/TradeWalletActions/TradeWalletActions.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { selectPerpsEnabledFlag } from '../../UI/Perps';
5050
import { selectPredictEnabledFlag } from '../../UI/Predict';
5151
import { EVENT_LOCATIONS as STAKE_EVENT_LOCATIONS } from '../../UI/Stake/constants/events';
5252
import { MetaMetricsEvents, useMetrics } from '../../hooks/useMetrics';
53+
import { isE2E } from '../../../util/test/utils';
5354

5455
import BottomShape from './components/BottomShape';
5556
import OverlayWithHole from './components/OverlayWithHole';
@@ -120,7 +121,13 @@ function TradeWalletActions() {
120121
const handleNavigateBack = useCallback(() => {
121122
onDismiss?.();
122123
setIsVisible(false);
123-
}, [onDismiss]);
124+
if (isE2E) {
125+
setIsVisible(false);
126+
navigation.goBack();
127+
postCallback.current?.();
128+
return;
129+
}
130+
}, [onDismiss, navigation]);
124131

125132
const goToSwaps = useCallback(() => {
126133
postCallback.current = () => {
@@ -233,7 +240,7 @@ function TradeWalletActions() {
233240
</MaskedView>
234241

235242
{visible && (
236-
<Animated.View exiting={exitingWithNavigateBack}>
243+
<Animated.View exiting={isE2E ? undefined : exitingWithNavigateBack}>
237244
<MaskedView
238245
maskElement={
239246
<View style={tw.style('flex-1 bg-transparent px-4')}>
@@ -254,11 +261,13 @@ function TradeWalletActions() {
254261
}
255262
>
256263
<Animated.View
257-
entering={FadeInDown.duration(
258-
animationDuration,
259-
).withInitialValues({
260-
transform: [{ translateY: 50 }],
261-
})}
264+
entering={
265+
isE2E
266+
? undefined
267+
: FadeInDown.duration(animationDuration).withInitialValues({
268+
transform: [{ translateY: 50 }],
269+
})
270+
}
262271
>
263272
<Box
264273
style={tw.style(

e2e/api-mocking/mock-e2e-allowlist.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export const ALLOWLISTED_HOSTS = [
2121

2222
export const ALLOWLISTED_URLS = [
2323
// Temporarily allow existing live requests during migration
24-
'https://client-config.api.cx.metamask.io/v1/flags?client=mobile&distribution=main&environment=dev',
2524
'https://clients3.google.com/generate_204',
2625
'https://api.avax.network/ext/bc/C/rpc',
2726
// Token SVGs in notifications list
@@ -49,7 +48,6 @@ export const ALLOWLISTED_URLS = [
4948
'https://nft.api.cx.metamask.io/collections?contract=0xb66a603f4cfe17e3d27b87a8bfcad319856518b8&chainId=1',
5049
'https://nft.api.cx.metamask.io/users/0x76cf1cdd1fcc252442b50d6e97207228aa4aefc3/tokens?chainIds=1&limit=50&includeTopBid=true&continuation=',
5150
'https://bridge.dev-api.cx.metamask.io/getTokens?chainId=1',
52-
'https://client-config.api.cx.metamask.io/v1/flags?client=mobile&distribution=flask&environment=dev',
5351
'https://acl.execution.metamask.io/latest/registry.json',
5452
'https://acl.execution.metamask.io/latest/signature.json',
5553
'https://signature-insights.api.cx.metamask.io/v1/signature?chainId=0x1',

0 commit comments

Comments
 (0)