Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ describe('MessageTemplates component', () => {

expect(container.asFragment()).toMatchSnapshot();
});

it('matches snapshot with pending proof request status', () => {
messageTemplatesProps.templateList[0].templateStatus =
'PENDING_PROOF_REQUEST';
const container = render(<MessageTemplates {...messageTemplatesProps} />);

expect(container.asFragment()).toMatchSnapshot();
});
it('renders component correctly', () => {
render(<MessageTemplates {...messageTemplatesProps} />);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,330 @@ exports[`MessageTemplates component matches snapshot with not submitted status 1
</DocumentFragment>
`;

exports[`MessageTemplates component matches snapshot with pending proof request status 1`] = `
<DocumentFragment>
<div
class="nhsuk-grid-row"
>
<div
class="nhsuk-grid-column-full"
>
<table
class="nhsuk-table-responsive"
data-testid="manage-template-table"
id="manage-template-table"
>
<caption
class="nhsuk-table__caption"
>
List of templates
</caption>
<thead
class="nhsuk-table__head"
role="rowgroup"
>
<tr
class="nhsuk-table__row"
>
<th
class="nhsuk-table__header"
data-testid="manage-template-table-header-template-name"
scope="col"
>
Name
</th>
<th
class="nhsuk-table__header"
data-testid="manage-template-table-header-template-type"
scope="col"
>
Type
</th>
<th
class="nhsuk-table__header"
data-testid="manage-template-table-header-template-status"
scope="col"
>
Status
</th>
<th
class="nhsuk-table__header"
data-testid="manage-template-table-header-template-date-created"
scope="col"
>
Date created
</th>
<th
class="nhsuk-table__header"
data-testid="manage-template-table-header-action"
scope="col"
>
Action
</th>
</tr>
</thead>
<tbody
class="nhsuk-table__body"
>
<tr
class="nhsuk-table__row"
>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Name
</span>
<a
href="/preview-nhs-app-template/1"
>
Template 1
</a>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Type
</span>
NHS App message
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Status
</span>
<strong
class="nhsuk-tag nhsuk-tag--blue"
>
Files uploaded
</strong>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Date created
</span>
1st Jan 2021
<br />
00:00
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Action
</span>
<div
class="actionLinksWrapper"
>
<p
class="nhsuk-u-margin-bottom-2"
>
<a
aria-label="Copy Template 1"
href="/copy-template/1"
id="copy-template-link-0"
>
Copy
</a>
</p>
</div>
</td>
</tr>
<tr
class="nhsuk-table__row"
>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Name
</span>
<a
href="/preview-submitted-nhs-app-template/2"
>
Template 2
</a>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Type
</span>
NHS App message
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Status
</span>
<strong
class="nhsuk-tag nhsuk-tag--grey"
>
Submitted
</strong>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Date created
</span>
1st Feb 2021
<br />
00:00
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Action
</span>
<div
class="actionLinksWrapper"
>
<p
class="nhsuk-u-margin-bottom-2"
>
<a
aria-label="Copy Template 2"
href="/copy-template/2"
id="copy-template-link-1"
>
Copy
</a>
</p>
</div>
</td>
</tr>
<tr
class="nhsuk-table__row"
>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Name
</span>
<a
href="/preview-submitted-letter-template/3"
>
Template 3
</a>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Type
</span>
Standard letter - French
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Status
</span>
<strong
class="nhsuk-tag nhsuk-tag--grey"
>
Submitted
</strong>
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Date created
</span>
1st Feb 2021
<br />
00:00
</td>
<td
class="nhsuk-table__cell"
role="cell"
>
<span
aria-hidden="true"
class="nhsuk-table-responsive__heading"
>
Action
</span>
<div
class="actionLinksWrapper"
/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</DocumentFragment>
`;

exports[`MessageTemplates component matches snapshot with submitted status 1`] = `
<DocumentFragment>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,30 @@ describe('PreviewLetterTemplate component', () => {

expect(container.asFragment()).toMatchSnapshot();
});

it('matches snapshot when template status is PENDING_PROOF_REQUEST', () => {
const container = render(
<PreviewLetterTemplate
template={{
id: '53525D03-1BC1-4563-ABF9-A74FF04142AF',
name: 'letter',
templateType: 'LETTER',
templateStatus: 'PENDING_PROOF_REQUEST',
letterType: 'q4',
language: 'ar',
files: {
pdfTemplate: {
fileName: 'file.pdf',
currentVersion: 'a',
virusScanStatus: 'PASSED',
},
},
createdAt: '2025-04-02T09:33:25.729Z',
updatedAt: '2025-04-02T09:33:25.729Z',
}}
/>
);

expect(container.asFragment()).toMatchSnapshot();
});
});
Loading
Loading