Skip to content

Commit fecd794

Browse files
authored
Merge branch 'main' into feat/bump-bitcoin-1-4-5
2 parents 14e9caa + 402fccb commit fecd794

File tree

20 files changed

+465
-745
lines changed

20 files changed

+465
-745
lines changed

.github/workflows/run-e2e-smoke-tests-android.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ jobs:
2929
changed_files: ${{ inputs.changed_files }}
3030
secrets: inherit
3131

32-
perps-android-smoke:
33-
strategy:
34-
matrix:
35-
split: [1]
36-
fail-fast: false
37-
uses: ./.github/workflows/run-e2e-workflow.yml
38-
with:
39-
test-suite-name: perps-android-smoke-${{ matrix.split }}
40-
platform: android
41-
test_suite_tag: 'SmokePerps'
42-
split_number: ${{ matrix.split }}
43-
total_splits: 1
44-
changed_files: ${{ inputs.changed_files }}
45-
secrets: inherit
32+
# perps-android-smoke:
33+
# strategy:
34+
# matrix:
35+
# split: [1]
36+
# fail-fast: false
37+
# uses: ./.github/workflows/run-e2e-workflow.yml
38+
# with:
39+
# test-suite-name: perps-android-smoke-${{ matrix.split }}
40+
# platform: android
41+
# test_suite_tag: 'SmokePerps'
42+
# split_number: ${{ matrix.split }}
43+
# total_splits: 1
44+
# changed_files: ${{ inputs.changed_files }}
45+
# secrets: inherit
4646

4747
wallet-platform-android-smoke:
4848
strategy:
@@ -170,7 +170,7 @@ jobs:
170170
if: ${{ !cancelled() }}
171171
needs:
172172
- trade-android-smoke
173-
- perps-android-smoke
173+
# - perps-android-smoke
174174
- wallet-platform-android-smoke
175175
- identity-android-smoke
176176
- accounts-android-smoke

app/components/Nav/App/App.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ import { Duration } from '@metamask/utils';
148148
import { selectSeedlessOnboardingLoginFlow } from '../../../selectors/seedlessOnboardingController';
149149
import { SmartAccountUpdateModal } from '../../Views/confirmations/components/smart-account-update-modal';
150150
import { PayWithModal } from '../../Views/confirmations/components/modals/pay-with-modal/pay-with-modal';
151-
import { PayWithNetworkModal } from '../../Views/confirmations/components/modals/pay-with-network-modal/pay-with-network-modal';
152151
import { useMetrics } from '../../hooks/useMetrics';
153152
import { State2AccountConnectWrapper } from '../../Views/MultichainAccounts/MultichainAccountConnect/State2AccountConnectWrapper';
154153
import { SmartAccountModal } from '../../Views/MultichainAccounts/AccountDetails/components/SmartAccountModal/SmartAccountModal';
@@ -1052,10 +1051,6 @@ const AppFlow = () => {
10521051
name={Routes.CONFIRMATION_PAY_WITH_MODAL}
10531052
component={PayWithModal}
10541053
/>
1055-
<Stack.Screen
1056-
name={Routes.CONFIRMATION_PAY_WITH_NETWORK_MODAL}
1057-
component={PayWithNetworkModal}
1058-
/>
10591054
</Stack.Navigator>
10601055
</>
10611056
);

app/components/UI/Card/Views/CardAuthentication/CardAuthentication.test.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ describe('CardAuthentication Component', () => {
939939
});
940940
});
941941

942-
describe('OTP Step - Error Handling', () => {
942+
describe.skip('OTP Step - Error Handling', () => {
943943
it('displays OTP error message when error exists', async () => {
944944
mockLogin.mockResolvedValue({
945945
isOtpRequired: true,
@@ -980,6 +980,16 @@ describe('CardAuthentication Component', () => {
980980
userId: 'user-123',
981981
phoneNumber: '+1 (555) 123-****',
982982
});
983+
mockUseCardProviderAuthentication.mockReturnValue({
984+
login: mockLogin,
985+
loading: false,
986+
error: null,
987+
clearError: mockClearError,
988+
sendOtpLogin: mockSendOtpLogin,
989+
otpLoading: false,
990+
otpError: 'The code you entered is incorrect',
991+
clearOtpError: mockClearOtpError,
992+
});
983993

984994
render();
985995
const emailInput = screen.getByPlaceholderText(
@@ -998,22 +1008,9 @@ describe('CardAuthentication Component', () => {
9981008
expect(
9991009
screen.getByText('Enter your verification code'),
10001010
).toBeOnTheScreen();
1001-
});
1002-
1003-
mockUseCardProviderAuthentication.mockReturnValue({
1004-
login: mockLogin,
1005-
loading: false,
1006-
error: null,
1007-
clearError: mockClearError,
1008-
sendOtpLogin: mockSendOtpLogin,
1009-
otpLoading: false,
1010-
otpError: 'The code you entered is incorrect',
1011-
clearOtpError: mockClearOtpError,
1012-
});
1013-
1014-
await waitFor(() => {
1015-
const errorText = screen.getByText('The code you entered is incorrect');
1016-
expect(errorText).toBeOnTheScreen();
1011+
expect(
1012+
screen.getByText('The code you entered is incorrect'),
1013+
).toBeOnTheScreen();
10171014
expect(screen.getByText('Verification Code')).toBeOnTheScreen();
10181015
});
10191016
});

app/components/Views/confirmations/components/UI/token/token.test.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BtcAccountType } from '@metamask/keyring-api';
44
import renderWithProvider from '../../../../../../util/test/renderWithProvider';
55
import { AssetType } from '../../../types/token';
66
import { Token } from './token';
7+
import { act, fireEvent } from '@testing-library/react-native';
78

89
describe('Token', () => {
910
const createMockToken = (overrides: Partial<AssetType> = {}): AssetType => ({
@@ -129,4 +130,48 @@ describe('Token', () => {
129130

130131
expect(getByText('Native SegWit')).toBeOnTheScreen();
131132
});
133+
134+
it('renders disabled message when token is disabled', () => {
135+
const mockToken = createMockToken({
136+
disabled: true,
137+
disabledMessage: 'Disabled Test',
138+
});
139+
140+
const { getByText } = renderWithProvider(
141+
<Token asset={mockToken} onPress={mockOnPress} />,
142+
);
143+
144+
expect(getByText('Disabled Test')).toBeOnTheScreen();
145+
});
146+
147+
it('calls onPress when token is pressed', async () => {
148+
const mockToken = createMockToken();
149+
150+
const { getByText } = renderWithProvider(
151+
<Token asset={mockToken} onPress={mockOnPress} />,
152+
);
153+
154+
await act(() => {
155+
fireEvent.press(getByText('ETH'));
156+
});
157+
158+
expect(mockOnPress).toHaveBeenCalledTimes(1);
159+
expect(mockOnPress).toHaveBeenCalledWith(mockToken);
160+
});
161+
162+
it('does not call onPress when token is disabled and pressed', async () => {
163+
const mockToken = createMockToken({
164+
disabled: true,
165+
});
166+
167+
const { getByText } = renderWithProvider(
168+
<Token asset={mockToken} onPress={mockOnPress} />,
169+
);
170+
171+
await act(() => {
172+
fireEvent.press(getByText('ETH'));
173+
});
174+
175+
expect(mockOnPress).not.toHaveBeenCalled();
176+
});
132177
});

app/components/Views/confirmations/components/UI/token/token.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export function Token({ asset, onPress }: TokenProps) {
4141

4242
return (
4343
<Pressable
44+
disabled={asset.disabled}
4445
style={({ pressed }) =>
4546
tw.style(
4647
'w-full flex-row items-center justify-between py-2 max-w-full',
4748
pressed || asset.isSelected ? 'bg-pressed' : 'bg-transparent',
49+
asset.disabled && 'opacity-50',
4850
)
4951
}
5052
onPress={handlePress}
@@ -98,7 +100,9 @@ export function Token({ asset, onPress }: TokenProps) {
98100
color={TextColor.TextAlternative}
99101
numberOfLines={1}
100102
>
101-
{asset.symbol}
103+
{!asset.disabled || !asset.disabledMessage
104+
? asset.symbol
105+
: asset.disabledMessage}
102106
</Text>
103107
</Box>
104108
</Box>

0 commit comments

Comments
 (0)