Skip to content

Commit

Permalink
feat: remove phishing detection from onboarding Security group (#27819)
Browse files Browse the repository at this point in the history
<!--
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**

<img width="620" alt="Screenshot 2024-10-14 at 11 57 53"
src="https://github.com/user-attachments/assets/f512cfb8-e770-4ad3-93ef-f4f441fc06cc">`


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27819?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#3497

## **Manual testing steps**

1. Onboard
2. Go to "Reminder set!" screen
3. Click on "Manage default settings"
4. Click on "Security"
5. Check that there's no 

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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-extension/blob/develop/.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.
  • Loading branch information
jonybur authored Oct 14, 2024
1 parent 1f1e142 commit bf31876
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
15 changes: 0 additions & 15 deletions ui/pages/onboarding-flow/privacy-settings/privacy-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import {
setIpfsGateway,
setUseCurrencyRateCheck,
setUseMultiAccountBalanceChecker,
setUsePhishDetect,
setUse4ByteResolution,
setUseTokenDetection,
setUseAddressBarEnsResolution,
Expand Down Expand Up @@ -132,7 +131,6 @@ export default function PrivacySettings() {
} = defaultState;
const petnamesEnabled = useSelector(getPetnamesEnabled);

const [usePhishingDetection, setUsePhishingDetection] = useState(null);
const [turnOn4ByteResolution, setTurnOn4ByteResolution] =
useState(use4ByteResolution);
const [turnOnTokenDetection, setTurnOnTokenDetection] =
Expand Down Expand Up @@ -160,17 +158,11 @@ export default function PrivacySettings() {
getExternalServicesOnboardingToggleState,
);

const phishingToggleState =
usePhishingDetection === null
? externalServicesOnboardingToggleState
: usePhishingDetection;

const profileSyncingProps = useProfileSyncingProps(
externalServicesOnboardingToggleState,
);

const handleSubmit = () => {
dispatch(setUsePhishDetect(phishingToggleState));
dispatch(setUse4ByteResolution(turnOn4ByteResolution));
dispatch(setUseTokenDetection(turnOnTokenDetection));
dispatch(
Expand Down Expand Up @@ -199,7 +191,6 @@ export default function PrivacySettings() {
is_profile_syncing_enabled: profileSyncingProps.isProfileSyncingEnabled,
is_basic_functionality_enabled: externalServicesOnboardingToggleState,
show_incoming_tx: incomingTransactionsPreferences,
use_phising_detection: usePhishingDetection,
turnon_token_detection: turnOnTokenDetection,
},
});
Expand Down Expand Up @@ -720,12 +711,6 @@ export default function PrivacySettings() {
) : null}
{selectedItem && selectedItem.id === 3 ? (
<>
<Setting
value={phishingToggleState}
setValue={setUsePhishingDetection}
title={t('usePhishingDetection')}
description={t('usePhishingDetectionDescription')}
/>
<Setting
value={turnOn4ByteResolution}
setValue={setTurnOn4ByteResolution}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ describe('Privacy Settings Onboarding View', () => {
[CHAIN_IDS.LINEA_GOERLI]: true,
[CHAIN_IDS.LINEA_SEPOLIA]: true,
},
usePhishDetect: true,
use4ByteResolution: true,
useTokenDetection: false,
useCurrencyRateCheck: true,
Expand All @@ -59,7 +58,6 @@ describe('Privacy Settings Onboarding View', () => {

const store = configureMockStore([thunk])(mockStore);
const setFeatureFlagStub = jest.fn();
const setUsePhishDetectStub = jest.fn();
const setUse4ByteResolutionStub = jest.fn();
const setUseTokenDetectionStub = jest.fn();
const setUseCurrencyRateCheckStub = jest.fn();
Expand All @@ -79,7 +77,6 @@ describe('Privacy Settings Onboarding View', () => {

setBackgroundConnection({
setFeatureFlag: setFeatureFlagStub,
setUsePhishDetect: setUsePhishDetectStub,
setUse4ByteResolution: setUse4ByteResolutionStub,
setUseTokenDetection: setUseTokenDetectionStub,
setUseCurrencyRateCheck: setUseCurrencyRateCheckStub,
Expand All @@ -104,7 +101,6 @@ describe('Privacy Settings Onboarding View', () => {
);
// All settings are initialized toggled to be same as default
expect(toggleExternalServicesStub).toHaveBeenCalledTimes(0);
expect(setUsePhishDetectStub).toHaveBeenCalledTimes(0);
expect(setUse4ByteResolutionStub).toHaveBeenCalledTimes(0);
expect(setUseTokenDetectionStub).toHaveBeenCalledTimes(0);
expect(setUseMultiAccountBalanceCheckerStub).toHaveBeenCalledTimes(0);
Expand Down Expand Up @@ -148,9 +144,8 @@ describe('Privacy Settings Onboarding View', () => {

toggles = container.querySelectorAll('input[type=checkbox]');

fireEvent.click(toggles[0]); // setUsePhishDetectStub
fireEvent.click(toggles[1]); // setUse4ByteResolutionStub
fireEvent.click(toggles[2]); // setPreferenceStub
fireEvent.click(toggles[0]); // setUse4ByteResolutionStub
fireEvent.click(toggles[1]); // setPreferenceStub

fireEvent.click(backButton);

Expand Down Expand Up @@ -179,8 +174,6 @@ describe('Privacy Settings Onboarding View', () => {
false,
);

expect(setUsePhishDetectStub).toHaveBeenCalledTimes(1);
expect(setUsePhishDetectStub.mock.calls[0][0]).toStrictEqual(false);
expect(setUse4ByteResolutionStub).toHaveBeenCalledTimes(1);
expect(setUse4ByteResolutionStub.mock.calls[0][0]).toStrictEqual(false);
expect(setPreferenceStub).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit bf31876

Please sign in to comment.