Skip to content

Commit ff5720b

Browse files
committed
CCM-8590: check for literal true
1 parent 1f86357 commit ff5720b

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

frontend/src/__tests__/app/choose-a-template-type/page.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test('ChooseATemplateTypePage', async () => {
3737
});
3838

3939
test('ChooseATemplateTypePage - LETTER option is hidden when feature flag is not enabled', async () => {
40-
delete process.env.NEXT_PUBLIC_ENABLE_LETTERS;
40+
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
4141

4242
const page = await ChooseATemplateTypePage();
4343

frontend/src/__tests__/app/copy-template/page.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('CopyTemplatePage', () => {
5050
});
5151

5252
it('Letter option is hidden when the feature flag is not enabled', async () => {
53-
delete process.env.NEXT_PUBLIC_ENABLE_LETTERS;
53+
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
5454

5555
getTemplateMock.mockResolvedValueOnce(template);
5656

frontend/src/__tests__/app/create-letter-template/page.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('CreateLetterTemplatePage', () => {
1313
});
1414

1515
it('returns 404 when letters feature flag is not enabled', async () => {
16-
delete process.env.NEXT_PUBLIC_ENABLE_LETTERS;
16+
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
1717

1818
await expect(CreateLetterTemplatePage()).rejects.toThrow('NEXT_NOT_FOUND');
1919
});

frontend/src/app/choose-a-template-type/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { TemplateType } from 'nhs-notify-backend-client';
55

66
const ChooseATemplateTypePage = async () => {
77
const templateTypes = Object.values(TemplateType).filter(
8-
(t) => process.env.NEXT_PUBLIC_ENABLE_LETTERS || t !== TemplateType.LETTER
8+
(t) =>
9+
process.env.NEXT_PUBLIC_ENABLE_LETTERS === 'true' ||
10+
t !== TemplateType.LETTER
911
);
1012

1113
return <ChooseTemplate templateTypes={templateTypes} />;

frontend/src/app/copy-template/[templateId]/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ const CopyTemplatePage = async (props: PageProps) => {
2222
}
2323

2424
const templateTypes = Object.values(TemplateType).filter(
25-
(t) => process.env.NEXT_PUBLIC_ENABLE_LETTERS || t !== TemplateType.LETTER
25+
(t) =>
26+
process.env.NEXT_PUBLIC_ENABLE_LETTERS === 'true' ||
27+
t !== TemplateType.LETTER
2628
);
2729

2830
return (

frontend/src/app/create-letter-template/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NHSNotifyMain } from '@atoms/NHSNotifyMain/NHSNotifyMain';
22
import { notFound } from 'next/navigation';
33

44
const CreateLetterTemplatePage = async () => {
5-
if (!process.env.NEXT_PUBLIC_ENABLE_LETTERS) notFound();
5+
if (process.env.NEXT_PUBLIC_ENABLE_LETTERS !== 'true') notFound();
66

77
return (
88
<NHSNotifyMain>

0 commit comments

Comments
 (0)