Skip to content

Commit

Permalink
MPDX-8169 Rename to Digital Newsletter (#1062)
Browse files Browse the repository at this point in the history
* Rename email newsletter to Digital
  • Loading branch information
caleballdrin authored Sep 12, 2024
1 parent 9f78c4f commit fd573ee
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ describe('PersonEmail', () => {
mutationSpy.mockClear();
});

it('Hides the Opt-out of Email Newsletter checkbox', async () => {
it('Hides the Opt-out of Digital Newsletter checkbox', async () => {
const { queryByRole } = render(
<Components showOptOutENewsletter={false} />,
);

expect(
queryByRole('checkbox', { name: 'Opt-out of Email Newsletter' }),
queryByRole('checkbox', { name: 'Opt-out of Digital Newsletter' }),
).not.toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const PersonEmail: React.FC<PersonEmailProps> = ({
}
/>
}
label={t('Opt-out of Email Newsletter')}
label={t('Opt-out of Digital Newsletter')}
/>
)}
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ describe('PersonModal', () => {
userEvent.click(getAllByLabelText('Email Address Type')[0]);
userEvent.click(getAllByLabelText('Personal')[0]);
userEvent.click(getAllByLabelText('Primary')[1]);
userEvent.click(getByLabelText('Opt-out of Email Newsletter'));
userEvent.click(getByLabelText('Opt-out of Digital Newsletter'));

userEvent.click(getByText('Save'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const MassActionsExportEmailsModal: React.FC<
<ContentWrapper data-testid="ExportEmailsModal">
<HelperText variant="body2">
{t(
'This is the primary email for every person in the selected contacts. If they are marked as "Opted out of Email Newsletter", they are not included in this list.',
'This is the primary email for every person in the selected contacts. If they are marked as "Opted out of Digital Newsletter", they are not included in this list.',
)}
</HelperText>
<HelperText variant="body2" style={{ color: theme.palette.error.dark }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('LogNewsletter', () => {
</GqlMockedProvider>
</ThemeProvider>,
);
expect(queryByText('Email Newsletter List')).toBeInTheDocument();
expect(queryByText('Digital Newsletter List')).toBeInTheDocument();
});

it('creates emailList string', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const CloseButton = styled(IconButton)(({ theme }) => ({
const TextArea = styled(TextareaAutosize)(() => ({
width: '100%',
}));
const StyledDialogContentText = styled(DialogContentText)(({ theme }) => ({
color: theme.palette.cruGrayDark.main,
}));

const ExportEmail = ({
accountListId,
Expand Down Expand Up @@ -66,24 +69,24 @@ const ExportEmail = ({
return (
<>
<ExportEmailTitle>
{t('Email Newsletter List')}
{t('Digital Newsletter List')}
<CloseButton onClick={handleClose}>
<CloseIcon titleAccess={t('Close')} />
</CloseButton>
</ExportEmailTitle>
<DialogContent dividers>
<>
<DialogContentText>
<StyledDialogContentText>
{t(
'This is the primary email for every person in contacts marked as Newsletter-Email or Newsletter-Both. If they are marked as "Opted out of Email Newsletter", they are not included in this list.',
'This is the primary email for every person in contacts marked as Newsletter-Digital or Newsletter-Both. If they are marked as "Opted out of Digital Newsletter", they are not included in this list.',
)}
</DialogContentText>
</StyledDialogContentText>
<br />
<DialogContentText>
<StyledDialogContentText>
{t(
'Reminder: Please only use the Bcc: field when sending emails to groups of partners.',
)}
</DialogContentText>
</StyledDialogContentText>
{loading ? (
<Skeleton
variant="text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('LogNewsletter', () => {
await waitFor(() => expect(handleClose).toHaveBeenCalled());
});

it('Logs Email Newsletter', async () => {
it('Logs Digital Newsletter', async () => {
const { getByLabelText, getByRole, getByText, findByText } = render(
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterLuxon}>
Expand All @@ -112,7 +112,7 @@ describe('LogNewsletter', () => {

userEvent.type(getByLabelText('Subject'), accountListId);
await waitFor(() => expect(getByText('Save')).not.toBeDisabled());
userEvent.click(getByRole('radio', { name: 'Newsletter - Email' }));
userEvent.click(getByRole('radio', { name: 'Digital Newsletter' }));
userEvent.click(getByText('Save'));
await waitFor(() => expect(handleClose).toHaveBeenCalled());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,17 @@ const LogNewsletter = ({
>
<LogFormControlLabel
value={ActivityTypeEnum.PartnerCarePhysicalNewsletter}
control={<Radio color="secondary" required />}
label={t('Newsletter - Physical')}
control={<Radio color="secondary" />}
label={t('Physical Newsletter')}
/>
<LogFormControlLabel
value={ActivityTypeEnum.PartnerCareDigitalNewsletter}
control={<Radio color="secondary" required />}
label={t('Newsletter - Email')}
control={<Radio color="secondary" />}
label={t('Digital Newsletter')}
/>
<LogFormControlLabel
value="BOTH"
control={<Radio color="secondary" required />}
control={<Radio color="secondary" />}
label={t('Both')}
/>
</RadioGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('NotificationMenuItem', () => {
</TestWrapper>,
);
expect(getByRole('button').textContent).toEqual(
'SSmith, RogerMay 25, 2020 — On your email newsletter list but has no people with a valid email address',
'SSmith, RogerMay 25, 2020 — On your digital newsletter list but has no people with a valid email address',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const NotificationMenuItem = ({
break;
case NotificationTypeTypeEnum.MissingEmailInNewsletter:
message = t(
'On your email newsletter list but has no people with a valid email address',
'On your digital newsletter list but has no people with a valid email address',
);
break;
case NotificationTypeTypeEnum.NewDesignationAccountSubscription:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/functions/getLocalizedSendNewsletter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getLocalizedSendNewsletter = (
return t('Both');

case SendNewsletterEnum.Email:
return t('Email');
return t('Digital');

case SendNewsletterEnum.None:
return t('None');
Expand Down

0 comments on commit fd573ee

Please sign in to comment.