1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

UX: Multichain: Restore Flask support link and text (#19198)

* UX: Multichain: Restore Flask support link and text

* Update test
This commit is contained in:
David Walsh 2023-06-06 11:02:00 -05:00 committed by GitHub
parent 51f6a29461
commit 7d7d09e469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -22,6 +22,9 @@ import { Menu, MenuItem } from '../../ui/menu';
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../shared/constants/app';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
import { SUPPORT_REQUEST_LINK } from '../../../helpers/constants/common';
///: END:ONLY_INCLUDE_IN
import { MetaMetricsContext } from '../../../contexts/metametrics';
import {
@ -59,6 +62,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
const unreadNotificationsCount = useSelector(getUnreadNotificationsCount);
///: END:ONLY_INCLUDE_IN
let supportText = t('support');
let supportLink = SUPPORT_LINK;
///: BEGIN:ONLY_INCLUDE_IN(build-beta,build-flask)
supportText = t('needHelpSubmitTicket');
supportLink = SUPPORT_REQUEST_LINK;
///: END:ONLY_INCLUDE_IN
return (
<Menu anchorElement={anchorElement} onHide={closeMenu}>
<MenuItem
@ -165,13 +175,13 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
<MenuItem
iconName={IconName.MessageQuestion}
onClick={() => {
global.platform.openTab({ url: SUPPORT_LINK });
global.platform.openTab({ url: supportLink });
trackEvent(
{
category: MetaMetricsEventCategory.Home,
event: MetaMetricsEventName.SupportLinkClicked,
properties: {
url: SUPPORT_LINK,
url: supportLink,
location: 'Global Menu',
},
},
@ -185,7 +195,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
}}
data-testid="global-menu-support"
>
{t('support')}
{supportText}
</MenuItem>
<MenuItem
iconName={IconName.Setting}

View File

@ -2,7 +2,6 @@ import React from 'react';
import { renderWithProvider, fireEvent, waitFor } from '../../../../test/jest';
import configureStore from '../../../store/store';
import mockState from '../../../../test/data/mock-state.json';
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
import { GlobalMenu } from '.';
const render = () => {
@ -49,9 +48,7 @@ describe('AccountListItem', () => {
const { getByTestId } = render();
fireEvent.click(getByTestId('global-menu-support'));
await waitFor(() => {
expect(global.platform.openTab).toHaveBeenCalledWith({
url: SUPPORT_LINK,
});
expect(global.platform.openTab).toHaveBeenCalled();
});
});