Skip to content

Commit

Permalink
Merge pull request #13698 from mozilla/FXA-417-in-devices-apps-use-th…
Browse files Browse the repository at this point in the history
…e-envelope-icon-for-email-preferences

feat(settings): Add icon+link for email prefs. Fix FXA-417
  • Loading branch information
clouserw authored Aug 1, 2022
2 parents 6b29ddd + 09b1b49 commit 55a9136
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ReactComponent as RelayIcon } from './relay.svg';
import { ReactComponent as AddonIcon } from './addon.svg';
import { ReactComponent as MDNPlusIcon } from './mdnplus.svg';
import { ReactComponent as PontoonIcon } from './pontoon.svg';
import { ReactComponent as MailIcon } from './mail.svg';
import { Localized } from '@fluent/react';

export function Service({
Expand Down Expand Up @@ -72,6 +73,10 @@ export function Service({
serviceLink = 'https://developer.mozilla.org/';
Icon = <MDNPlusIcon data-testid="mdnplus-icon" />;
break;
case 'Mozilla email preferences':
serviceLink = 'https://basket.mozilla.org/fxa/';
Icon = <MailIcon data-testid="mail-icon" />;
break;
case 'Pontoon':
serviceLink = 'https://pontoon.mozilla.org/';
Icon = <PontoonIcon data-testid="pontoon-icon" />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('Connected Services', () => {
const { sortedAndUniqueClients, groupedByName } =
sortAndFilterConnectedClients(MOCK_SERVICES);

expect(sortedAndUniqueClients.length).toEqual(12);
expect(sortedAndUniqueClients.length).toEqual(13);

expect(
sortedAndUniqueClients.filter((item) => item.name === 'Firefox Monitor')
Expand Down Expand Up @@ -205,6 +205,18 @@ describe('Connected Services', () => {
});
});

it('should show the Mail preferences icon and link', async () => {
await getIconAndServiceLink('Mozilla email preferences', 'mail-icon').then(
(result) => {
expect(result.icon).toBeTruthy();
expect(result.link).toHaveAttribute(
'href',
'https://basket.mozilla.org/fxa/'
);
}
);
});

it('should show the Pontoon icon and link', async () => {
await getIconAndServiceLink('Pontoon', 'pontoon-icon').then((result) => {
expect(result.icon).toBeTruthy();
Expand Down Expand Up @@ -259,7 +271,7 @@ describe('Connected Services', () => {
);
expect(
await screen.findAllByTestId('connected-service-sign-out')
).toHaveLength(12);
).toHaveLength(13);
});

it('renders proper modal when "sign out" is clicked', async () => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions packages/fxa-settings/src/components/ConnectedServices/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,31 @@ const OAUTH_SERVICE_MOCKS = [
approximateLastAccessTime: null,
approximateLastAccessTimeFormatted: null,
},
{
clientId: 'c40f32fd2938f0b6',
deviceId: null,
sessionTokenId: null,
refreshTokenId:
'e2e4001b8184721aba5cb7bf5df8f5af16d6f36dc144c1f40d9c86397cc22222',
isCurrentSession: false,
deviceType: null,
name: 'Mozilla email preferences',
createdTime: 1556745521001,
lastAccessTime: 1556745521001,
scope: null,
location: {
city: null,
country: null,
state: null,
stateCode: null,
},
userAgent: '',
os: null,
createdTimeFormatted: '6 months ago',
lastAccessTimeFormatted: '6 months ago',
approximateLastAccessTime: null,
approximateLastAccessTimeFormatted: null,
},
{
clientId: 'c87d36d7fd9a1bcf',
deviceId: null,
Expand Down

0 comments on commit 55a9136

Please sign in to comment.