Skip to content

Commit 10e9092

Browse files
committed
Merge branch 'main' of github.com:MetaMask/metamask-mobile into codex/v2-custom-actions-codeonly
2 parents 376a1a6 + 9104ee1 commit 10e9092

75 files changed

Lines changed: 873 additions & 225 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# typescript incremental build cache
2+
.tsbuildinfo
3+
14
# osx
25
.DS_Store
36
# don't save asdf tools-version config as nvm is prioritized.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const CHECKOUT_TEST_IDS = {
2+
CLOSE_BUTTON: 'checkout-close-button',
3+
WEBVIEW: 'checkout-webview',
4+
} as const;

app/components/UI/Ramp/Aggregator/Views/Checkout/Checkout.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { useStyles } from '../../../../../../component-library/hooks';
4242
import styleSheet from './Checkout.styles';
4343
import Device from '../../../../../../util/device';
4444
import { shouldStartLoadWithRequest } from '../../../../../../util/browser';
45+
import { CHECKOUT_TEST_IDS } from './Checkout.testIds';
4546

4647
interface CheckoutParams {
4748
url: string;
@@ -201,7 +202,7 @@ const CheckoutWebView = () => {
201202
iconName={IconName.Close}
202203
size={ButtonIconSizes.Lg}
203204
iconColor={IconColor.Default}
204-
testID="checkout-close-button"
205+
testID={CHECKOUT_TEST_IDS.CLOSE_BUTTON}
205206
onPress={handleClosePress}
206207
/>
207208
}
@@ -233,7 +234,7 @@ const CheckoutWebView = () => {
233234
iconName={IconName.Close}
234235
size={ButtonIconSizes.Lg}
235236
iconColor={IconColor.Default}
236-
testID="checkout-close-button"
237+
testID={CHECKOUT_TEST_IDS.CLOSE_BUTTON}
237238
onPress={handleClosePress}
238239
/>
239240
}
@@ -272,7 +273,7 @@ const CheckoutWebView = () => {
272273
iconName={IconName.Close}
273274
size={ButtonIconSizes.Lg}
274275
iconColor={IconColor.Default}
275-
testID="checkout-close-button"
276+
testID={CHECKOUT_TEST_IDS.CLOSE_BUTTON}
276277
onPress={handleClosePress}
277278
/>
278279
}
@@ -302,7 +303,7 @@ const CheckoutWebView = () => {
302303
onNavigationStateChange={handleNavigationStateChange}
303304
onShouldStartLoadWithRequest={handleShouldStartLoadWithRequest}
304305
userAgent={provider?.features?.buy?.userAgent ?? undefined}
305-
testID="checkout-webview"
306+
testID={CHECKOUT_TEST_IDS.WEBVIEW}
306307
/>
307308
</BottomSheet>
308309
);
@@ -321,7 +322,7 @@ const CheckoutWebView = () => {
321322
iconName={IconName.Close}
322323
size={ButtonIconSizes.Lg}
323324
iconColor={IconColor.Default}
324-
testID="checkout-close-button"
325+
testID={CHECKOUT_TEST_IDS.CLOSE_BUTTON}
325326
onPress={handleClosePress}
326327
/>
327328
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const CUSTOM_ACTION_TEST_IDS = {
2+
ANIMATED_VIEW_OPACITY: 'animated-view-opacity',
3+
ANIMATED_VIEW_HEIGHT: 'animated-view-height',
4+
} as const;

app/components/UI/Ramp/Aggregator/components/CustomAction/CustomAction.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import TagColored from '../../../../../../component-library/components-temp/TagC
2323
import styleSheet from './CustomAction.styles';
2424
import { useStyles } from '../../../../../../component-library/hooks';
2525
import ListItem from '../../../../../../component-library/components/List/ListItem';
26+
import { CUSTOM_ACTION_TEST_IDS } from './CustomAction.testIds';
2627

2728
interface Props {
2829
customAction: PaymentCustomAction;
@@ -82,7 +83,10 @@ const CustomAction: React.FC<Props> = ({
8283
}));
8384

8485
return (
85-
<Animated.View style={animatedOpacity} testID="animated-view-opacity">
86+
<Animated.View
87+
style={animatedOpacity}
88+
testID={CUSTOM_ACTION_TEST_IDS.ANIMATED_VIEW_OPACITY}
89+
>
8690
<Box
8791
onPress={highlighted ? undefined : onPress}
8892
highlighted={highlighted}
@@ -136,7 +140,7 @@ const CustomAction: React.FC<Props> = ({
136140
<Animated.View
137141
onLayout={handleOnLayout}
138142
style={[styles.data, animatedStyle]}
139-
testID="animated-view-height"
143+
testID={CUSTOM_ACTION_TEST_IDS.ANIMATED_VIEW_HEIGHT}
140144
>
141145
<View style={styles.buyButton}>
142146
<Button
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const QUOTE_TEST_IDS = {
2+
ANIMATED_VIEW_OPACITY: 'animated-view-opacity',
3+
ANIMATED_VIEW_HEIGHT: 'animated-view-height',
4+
} as const;

app/components/UI/Ramp/Aggregator/components/Quote/Quote.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import Button, {
4040
ButtonVariants,
4141
ButtonWidthTypes,
4242
} from '../../../../../../component-library/components/Buttons/Button';
43+
import { QUOTE_TEST_IDS } from './Quote.testIds';
4344

4445
interface Props {
4546
quote: QuoteResponse | SellQuoteResponse;
@@ -118,7 +119,10 @@ const Quote: React.FC<Props> = ({
118119
}));
119120

120121
return (
121-
<Animated.View style={animatedOpacity} testID="animated-view-opacity">
122+
<Animated.View
123+
style={animatedOpacity}
124+
testID={QUOTE_TEST_IDS.ANIMATED_VIEW_OPACITY}
125+
>
122126
<Box
123127
onPress={highlighted ? undefined : onPress}
124128
highlighted={highlighted}
@@ -182,7 +186,7 @@ const Quote: React.FC<Props> = ({
182186
<Animated.View
183187
onLayout={handleOnLayout}
184188
style={[styles.data, animatedStyle]}
185-
testID="animated-view-height"
189+
testID={QUOTE_TEST_IDS.ANIMATED_VIEW_HEIGHT}
186190
>
187191
<View style={styles.buyButton}>
188192
{isBuyQuote(quote, rampType) && quote.isNativeApplePay ? (
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const SHAPES_BACKGROUND_ANIMATION_TEST_IDS = {
2+
CONTAINER: 'shapes-background-animation',
3+
} as const;

app/components/UI/Ramp/Aggregator/components/ShapesBackgroundAnimation/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import React, { useEffect } from 'react';
33
import { Animated, Easing, StyleSheet } from 'react-native';
44
import Svg, { Path, LinearGradient, Stop, Defs } from 'react-native-svg';
5+
import { SHAPES_BACKGROUND_ANIMATION_TEST_IDS } from './ShapesBackgroundAnimation.testIds';
56

67
const styles = StyleSheet.create({
78
container: {
@@ -41,7 +42,7 @@ const ShapesBackgroundAnimation = ({
4142

4243
return (
4344
<Animated.View
44-
testID="shapes-background-animation"
45+
testID={SHAPES_BACKGROUND_ANIMATION_TEST_IDS.CONTAINER}
4546
style={[
4647
styles.container,
4748
{
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const BANK_DETAILS_TEST_IDS = {
2+
REFRESH_CONTROL_SCROLLVIEW: 'bank-details-refresh-control-scrollview',
3+
MAIN_ACTION_BUTTON: 'main-action-button',
4+
} as const;

0 commit comments

Comments
 (0)