Skip to content

Commit 1937f9a

Browse files
chore(3663): removing the isMultichainVersion1Enabled feature flag, and corresponding dead code (#12831)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** - Step 1 **(done)**: remove code that ran in the feature flag OFF scenario, confirm stuff runs as expected (manually and e2e) - Step 2 **(done)**: remove any left over checks on the feature flags, for examples checks that used only feature flag ON to render something specific to that scenario - Step 3 **(done)**: address unit test snapshots tests failing, all the while using these snapshots to ensure expected behavior is maintained, comparing a test that runs with FF OFF, to the existing snapshot on main, this test should pass since FF OFF is the default, this a baseline. Next, compare the snapshot generated from a FF ON test running on the code with feature flag, to the snapshot generated once all the dead code and feature flag code is removed, that test should pass since FF ON becomes the default behavior once feature flag and dead code is removed. - Step 4 **(done)**: address unit tests that fail on things other than snapshots, find out why they are failing - Step 5 **(done)**: added coverage on new code (Sonar) <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 3. What is the improvement/solution? --> ## **Related issues** Contributes to: MetaMask/MetaMask-planning#3663 ## **Manual testing steps** 1. Go to the in app browser and test-dapp 2. Connect to it 3. Click the top header in the in-app browser, confirm the expected permissions as displaying. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** It's a refactoring, to the user it looks the same before and after. ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 9feefd3 commit 1937f9a

File tree

31 files changed

+1703
-2135
lines changed

31 files changed

+1703
-2135
lines changed

app/components/Approvals/SwitchChainApproval/SwitchChainApproval.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const SwitchChainApproval = () => {
5858
onConfirm={onConfirm}
5959
currentPageInformation={pageMeta}
6060
customNetworkInformation={approvalRequest?.requestData}
61-
type={approvalRequest?.requestData?.type}
6261
/>
6362
</ApprovalModal>
6463
);

app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ exports[`NetworkDetails renders correctly 1`] = `
186186
}
187187
}
188188
>
189-
Add Network
189+
Add Test Network
190190
</Text>
191191
</View>
192192
<View
@@ -338,15 +338,15 @@ exports[`NetworkDetails renders correctly 1`] = `
338338
style={
339339
{
340340
"color": "#141618",
341-
"fontFamily": "EuclidCircularB-Bold",
341+
"fontFamily": "EuclidCircularB-Medium",
342342
"fontSize": 14,
343-
"fontWeight": "700",
343+
"fontWeight": "500",
344344
"letterSpacing": 0,
345345
"lineHeight": 22,
346346
}
347347
}
348348
>
349-
Display name
349+
Currency symbol
350350
</Text>
351351
<Text
352352
accessibilityRole="text"
@@ -362,54 +362,33 @@ exports[`NetworkDetails renders correctly 1`] = `
362362
}
363363
}
364364
>
365-
Test Network
365+
TEST
366366
</Text>
367-
<Text
368-
accessibilityRole="text"
369-
style={
370-
{
371-
"color": "#141618",
372-
"fontFamily": "EuclidCircularB-Bold",
373-
"fontSize": 14,
374-
"fontWeight": "700",
375-
"letterSpacing": 0,
376-
"lineHeight": 22,
377-
}
378-
}
379-
>
380-
Chain ID
381-
</Text>
382-
<Text
383-
accessibilityRole="text"
367+
<View
384368
style={
385369
{
386-
"color": "#141618",
387-
"fontFamily": "EuclidCircularB-Regular",
388-
"fontSize": 14,
389-
"fontWeight": "400",
390-
"letterSpacing": 0,
391-
"lineHeight": 22,
392-
"marginBottom": 8,
370+
"alignItems": "center",
371+
"flexDirection": "row",
372+
"gap": 8,
393373
}
394374
}
395375
>
396-
1
397-
</Text>
398-
<Text
399-
accessibilityRole="text"
400-
style={
401-
{
402-
"color": "#141618",
403-
"fontFamily": "EuclidCircularB-Bold",
404-
"fontSize": 14,
405-
"fontWeight": "700",
406-
"letterSpacing": 0,
407-
"lineHeight": 22,
376+
<Text
377+
accessibilityRole="text"
378+
style={
379+
{
380+
"color": "#141618",
381+
"fontFamily": "EuclidCircularB-Medium",
382+
"fontSize": 14,
383+
"fontWeight": "500",
384+
"letterSpacing": 0,
385+
"lineHeight": 22,
386+
}
408387
}
409-
}
410-
>
411-
Network URL
412-
</Text>
388+
>
389+
Network RPC URL
390+
</Text>
391+
</View>
413392
<Text
414393
accessibilityRole="text"
415394
style={

app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.ff-on.test.tsx

Lines changed: 0 additions & 133 deletions
This file was deleted.

app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.test.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import NetworkVerificationInfo from './NetworkVerificationInfo';
3-
import { render } from '@testing-library/react-native';
3+
import { render, fireEvent } from '@testing-library/react-native';
44
import { BannerAlertSeverity } from '../../../component-library/components/Banners/Banner';
55
import { strings } from '../../../../locales/i18n';
66
import { useSelector } from 'react-redux';
@@ -85,7 +85,7 @@ describe('NetworkVerificationInfo', () => {
8585
).toThrow('Unable to find an element with text');
8686
});
8787

88-
it('should render chainId on decimal', () => {
88+
it('should render chainId as a decimal', () => {
8989
(useSelector as jest.Mock).mockReturnValue(true);
9090
const { getByText } = render(
9191
<NetworkVerificationInfo
@@ -95,6 +95,12 @@ describe('NetworkVerificationInfo', () => {
9595
/>,
9696
);
9797

98+
// Accordion content is hidden by default, so we need to expand it
99+
const accordionButton = getByText(
100+
strings('spend_limit_edition.view_details'),
101+
);
102+
fireEvent.press(accordionButton);
103+
98104
expect(getByText('10')).toBeTruthy();
99105
});
100106

0 commit comments

Comments
 (0)