Skip to content

Commit 8439d3a

Browse files
refactor: remove learn more link from MainNotificationToggle component and associated tests
1 parent 8993554 commit 8439d3a

2 files changed

Lines changed: 3 additions & 38 deletions

File tree

app/components/Views/Settings/NotificationsSettings/MainNotificationToggle.test.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { fireEvent, render, waitFor } from '@testing-library/react-native';
22
import React from 'react';
33
import { Linking } from 'react-native';
4-
import AppConstants from '../../../../core/AppConstants';
54
import {
6-
MAIN_NOTIFICATION_TOGGLE_LEARN_MORE_TEST_ID,
75
MAIN_NOTIFICATION_TOGGLE_TEST_ID,
86
MainNotificationToggle,
97
} from './MainNotificationToggle';
@@ -57,20 +55,4 @@ describe('MainNotificationToggle', () => {
5755
expect(mocks.mockOnToggle).toHaveBeenCalled();
5856
});
5957
});
60-
61-
it('opens learn more link', async () => {
62-
const mocks = arrangeMocks();
63-
const { getByTestId } = render(<MainNotificationToggle />);
64-
const learnMoreText = getByTestId(
65-
MAIN_NOTIFICATION_TOGGLE_LEARN_MORE_TEST_ID,
66-
);
67-
68-
fireEvent.press(learnMoreText);
69-
70-
await waitFor(() => {
71-
expect(mocks.mockOpenURL).toHaveBeenCalledWith(
72-
AppConstants.URLS.PROFILE_SYNC,
73-
);
74-
});
75-
});
7658
});

app/components/Views/Settings/NotificationsSettings/MainNotificationToggle.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,23 @@ import {
1010
TextVariant,
1111
} from '@metamask/design-system-react-native';
1212
import { useStyles } from '../../../../component-library/hooks';
13-
import AppConstants from '../../../../core/AppConstants';
1413
import { useMainNotificationToggle } from './MainNotificationToggle.hooks';
1514
import styleSheet from './NotificationsSettings.styles';
1615
import { NotificationSettingsViewSelectorsIDs } from './NotificationSettingsView.testIds';
1716

1817
export const MAIN_NOTIFICATION_TOGGLE_TEST_ID = 'main-notification-toggle';
19-
export const MAIN_NOTIFICATION_TOGGLE_LEARN_MORE_TEST_ID =
20-
'main-notification-toggle--learn-more-button';
2118

2219
export const MainNotificationToggle = () => {
2320
const theme = useTheme();
2421
const { styles } = useStyles(styleSheet, { theme });
2522

2623
const { onToggle, value } = useMainNotificationToggle();
2724

28-
const goToLearnMore = useCallback(() => {
29-
Linking.openURL(AppConstants.URLS.PROFILE_SYNC);
30-
}, []);
31-
3225
return (
3326
<>
27+
<Text color={TextColor.TextAlternative} variant={TextVariant.BodySm}>
28+
{strings('app_settings.allow_notifications_desc')}
29+
</Text>
3430
<View
3531
style={styles.switchElement}
3632
testID={MAIN_NOTIFICATION_TOGGLE_TEST_ID}
@@ -55,19 +51,6 @@ export const MainNotificationToggle = () => {
5551
testID={NotificationSettingsViewSelectorsIDs.NOTIFICATIONS_TOGGLE}
5652
/>
5753
</View>
58-
<View style={styles.setting}>
59-
<Text color={TextColor.TextAlternative} variant={TextVariant.BodySm}>
60-
{strings('app_settings.allow_notifications_desc')}{' '}
61-
<Text
62-
variant={TextVariant.BodySm}
63-
color={TextColor.InfoDefault}
64-
onPress={goToLearnMore}
65-
testID={MAIN_NOTIFICATION_TOGGLE_LEARN_MORE_TEST_ID}
66-
>
67-
{strings('notifications.activation_card.learn_more')}
68-
</Text>
69-
</Text>
70-
</View>
7154
</>
7255
);
7356
};

0 commit comments

Comments
 (0)