Skip to content

Commit 7540ff4

Browse files
committed
CCM-11544 Test fixes
1 parent e47562c commit 7540ff4

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

frontend/src/__tests__/app/message-plans/choose-large-print-letter-template/__snapshots__/page.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ exports[`ChooseLargePrintLetterTemplate page renders large print letter template
202202
aria-label="Preview"
203203
class="nhsuk-u-margin-bottom-2 nhsuk-link"
204204
data-testid="large-print-letter-template-id-preview-link"
205-
href="/message-plans/choose-standard-english-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
205+
href="/message-plans/choose-large-print-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
206206
id="preview-template-link-0"
207207
>
208208
Preview

frontend/src/__tests__/components/forms/ChooseChannelTemplate/__snapshots__/ChooseChannelTemplate.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ exports[`ChooseChannelTemplate renders large print letter form with accessibleFo
10351035
aria-label="Preview"
10361036
class="nhsuk-u-margin-bottom-2 nhsuk-link"
10371037
data-testid="large-print-letter-template-id-preview-link"
1038-
href="/message-plans/choose-standard-english-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
1038+
href="/message-plans/choose-large-print-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
10391039
id="preview-template-link-0"
10401040
>
10411041
Preview
@@ -2612,7 +2612,7 @@ exports[`ChooseChannelTemplate when there is a conditional template selected ren
26122612
aria-label="Preview"
26132613
class="nhsuk-u-margin-bottom-2 nhsuk-link"
26142614
data-testid="large-print-template-2-preview-link"
2615-
href="/message-plans/choose-standard-english-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-template-2"
2615+
href="/message-plans/choose-large-print-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-template-2"
26162616
id="preview-template-link-0"
26172617
>
26182618
Preview
@@ -2705,7 +2705,7 @@ exports[`ChooseChannelTemplate when there is a conditional template selected ren
27052705
aria-label="Preview"
27062706
class="nhsuk-u-margin-bottom-2 nhsuk-link"
27072707
data-testid="large-print-letter-template-id-preview-link"
2708-
href="/message-plans/choose-standard-english-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
2708+
href="/message-plans/choose-large-print-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-letter-template-id"
27092709
id="preview-template-link-1"
27102710
>
27112711
Preview
@@ -2797,7 +2797,7 @@ exports[`ChooseChannelTemplate when there is a conditional template selected ren
27972797
aria-label="Preview"
27982798
class="nhsuk-u-margin-bottom-2 nhsuk-link"
27992799
data-testid="large-print-template-3-preview-link"
2800-
href="/message-plans/choose-standard-english-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-template-3"
2800+
href="/message-plans/choose-large-print-letter-template/fbb81055-79b9-4759-ac07-d191ae57be34/preview-template/large-print-template-3"
28012801
id="preview-template-link-2"
28022802
>
28032803
Preview

frontend/src/components/forms/ChooseChannelTemplate/ChooseChannelTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function ChooseChannelTemplate(props: ChooseChannelTemplateProps) {
100100
templateList={templateList}
101101
errorState={errorState || null}
102102
selectedTemplate={selectedTemplateId}
103+
letterType={accessibleFormat}
103104
/>
104105
) : (
105106
<p data-testid='no-templates-message'>

frontend/src/components/molecules/ChannelTemplates/ChannelTemplates.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
ErrorState,
1111
cascadeTemplateTypeToUrlTextMappings,
1212
} from 'nhs-notify-web-template-management-utils';
13-
import { TemplateDto } from 'nhs-notify-backend-client';
13+
import { LetterType, TemplateDto } from 'nhs-notify-backend-client';
1414
import { interpolate } from '@utils/interpolate';
1515

1616
const { tableHintText, tableContent } =
@@ -26,11 +26,13 @@ export function ChannelTemplates({
2626
templateList,
2727
errorState,
2828
selectedTemplate,
29+
letterType,
2930
}: {
3031
routingConfigId: string;
3132
templateList: TemplateDto[];
3233
errorState: ErrorState | null;
3334
selectedTemplate: string | null;
35+
letterType?: LetterType;
3436
}) {
3537
return (
3638
<div className='nhsuk-grid-row'>
@@ -94,7 +96,8 @@ export function ChannelTemplates({
9496
className='nhsuk-u-margin-bottom-2 nhsuk-link'
9597
href={interpolate(tableContent.action.preview.href, {
9698
templateType: cascadeTemplateTypeToUrlTextMappings(
97-
template.templateType
99+
template.templateType,
100+
letterType
98101
),
99102
routingConfigId,
100103
templateId: template.id,

0 commit comments

Comments
 (0)