Skip to content

Commit 27bf512

Browse files
authored
Merge branch 'main' into feature/CCM-10057_user-transfer-data-migration
2 parents ac540cd + 9f1b533 commit 27bf512

File tree

14 files changed

+720
-19
lines changed

14 files changed

+720
-19
lines changed

frontend/src/__tests__/components/molecules/MessageTemplates.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe('MessageTemplates component', () => {
5353

5454
expect(container.asFragment()).toMatchSnapshot();
5555
});
56+
5657
it('matches snapshot with submitted status', () => {
5758
messageTemplatesProps.templateList[0].templateStatus = 'SUBMITTED';
5859
const container = render(<MessageTemplates {...messageTemplatesProps} />);
@@ -67,6 +68,14 @@ describe('MessageTemplates component', () => {
6768

6869
expect(container.asFragment()).toMatchSnapshot();
6970
});
71+
72+
it('matches snapshot with waiting for proof status', () => {
73+
messageTemplatesProps.templateList[0].templateStatus = 'WAITING_FOR_PROOF';
74+
const container = render(<MessageTemplates {...messageTemplatesProps} />);
75+
76+
expect(container.asFragment()).toMatchSnapshot();
77+
});
78+
7079
it('renders component correctly', () => {
7180
render(<MessageTemplates {...messageTemplatesProps} />);
7281

frontend/src/__tests__/components/molecules/__snapshots__/MessageTemplates.test.tsx.snap

Lines changed: 312 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,318 @@ exports[`MessageTemplates component matches snapshot with pending proof request
668668
</DocumentFragment>
669669
`;
670670

671+
exports[`MessageTemplates component matches snapshot with waiting for proof status 1`] = `
672+
<DocumentFragment>
673+
<div
674+
class="nhsuk-grid-row"
675+
>
676+
<div
677+
class="nhsuk-grid-column-full"
678+
>
679+
<table
680+
class="nhsuk-table-responsive"
681+
data-testid="manage-template-table"
682+
id="manage-template-table"
683+
>
684+
<caption
685+
class="nhsuk-table__caption"
686+
>
687+
List of templates
688+
</caption>
689+
<thead
690+
class="nhsuk-table__head"
691+
role="rowgroup"
692+
>
693+
<tr
694+
class="nhsuk-table__row"
695+
>
696+
<th
697+
class="nhsuk-table__header"
698+
data-testid="manage-template-table-header-template-name"
699+
scope="col"
700+
>
701+
Name
702+
</th>
703+
<th
704+
class="nhsuk-table__header"
705+
data-testid="manage-template-table-header-template-type"
706+
scope="col"
707+
>
708+
Type
709+
</th>
710+
<th
711+
class="nhsuk-table__header"
712+
data-testid="manage-template-table-header-template-status"
713+
scope="col"
714+
>
715+
Status
716+
</th>
717+
<th
718+
class="nhsuk-table__header"
719+
data-testid="manage-template-table-header-template-date-created"
720+
scope="col"
721+
>
722+
Date created
723+
</th>
724+
<th
725+
class="nhsuk-table__header"
726+
data-testid="manage-template-table-header-action"
727+
scope="col"
728+
>
729+
Action
730+
</th>
731+
</tr>
732+
</thead>
733+
<tbody
734+
class="nhsuk-table__body"
735+
>
736+
<tr
737+
class="nhsuk-table__row"
738+
>
739+
<td
740+
class="nhsuk-table__cell"
741+
role="cell"
742+
>
743+
<span
744+
aria-hidden="true"
745+
class="nhsuk-table-responsive__heading"
746+
>
747+
Name
748+
</span>
749+
<a
750+
href="/preview-nhs-app-template/1"
751+
>
752+
Template 1
753+
</a>
754+
</td>
755+
<td
756+
class="nhsuk-table__cell"
757+
role="cell"
758+
>
759+
<span
760+
aria-hidden="true"
761+
class="nhsuk-table-responsive__heading"
762+
>
763+
Type
764+
</span>
765+
NHS App message
766+
</td>
767+
<td
768+
class="nhsuk-table__cell"
769+
role="cell"
770+
>
771+
<span
772+
aria-hidden="true"
773+
class="nhsuk-table-responsive__heading"
774+
>
775+
Status
776+
</span>
777+
<strong
778+
class="nhsuk-tag nhsuk-tag--yellow"
779+
>
780+
Waiting for proof
781+
</strong>
782+
</td>
783+
<td
784+
class="nhsuk-table__cell"
785+
role="cell"
786+
>
787+
<span
788+
aria-hidden="true"
789+
class="nhsuk-table-responsive__heading"
790+
>
791+
Date created
792+
</span>
793+
1st Jan 2021
794+
<br />
795+
00:00
796+
</td>
797+
<td
798+
class="nhsuk-table__cell"
799+
role="cell"
800+
>
801+
<span
802+
aria-hidden="true"
803+
class="nhsuk-table-responsive__heading"
804+
>
805+
Action
806+
</span>
807+
<div
808+
class="actionLinksWrapper"
809+
/>
810+
</td>
811+
</tr>
812+
<tr
813+
class="nhsuk-table__row"
814+
>
815+
<td
816+
class="nhsuk-table__cell"
817+
role="cell"
818+
>
819+
<span
820+
aria-hidden="true"
821+
class="nhsuk-table-responsive__heading"
822+
>
823+
Name
824+
</span>
825+
<a
826+
href="/preview-submitted-nhs-app-template/2"
827+
>
828+
Template 2
829+
</a>
830+
</td>
831+
<td
832+
class="nhsuk-table__cell"
833+
role="cell"
834+
>
835+
<span
836+
aria-hidden="true"
837+
class="nhsuk-table-responsive__heading"
838+
>
839+
Type
840+
</span>
841+
NHS App message
842+
</td>
843+
<td
844+
class="nhsuk-table__cell"
845+
role="cell"
846+
>
847+
<span
848+
aria-hidden="true"
849+
class="nhsuk-table-responsive__heading"
850+
>
851+
Status
852+
</span>
853+
<strong
854+
class="nhsuk-tag nhsuk-tag--grey"
855+
>
856+
Submitted
857+
</strong>
858+
</td>
859+
<td
860+
class="nhsuk-table__cell"
861+
role="cell"
862+
>
863+
<span
864+
aria-hidden="true"
865+
class="nhsuk-table-responsive__heading"
866+
>
867+
Date created
868+
</span>
869+
1st Feb 2021
870+
<br />
871+
00:00
872+
</td>
873+
<td
874+
class="nhsuk-table__cell"
875+
role="cell"
876+
>
877+
<span
878+
aria-hidden="true"
879+
class="nhsuk-table-responsive__heading"
880+
>
881+
Action
882+
</span>
883+
<div
884+
class="actionLinksWrapper"
885+
>
886+
<p
887+
class="nhsuk-u-margin-bottom-2"
888+
>
889+
<a
890+
aria-label="Copy Template 2"
891+
href="/copy-template/2"
892+
id="copy-template-link-1"
893+
>
894+
Copy
895+
</a>
896+
</p>
897+
</div>
898+
</td>
899+
</tr>
900+
<tr
901+
class="nhsuk-table__row"
902+
>
903+
<td
904+
class="nhsuk-table__cell"
905+
role="cell"
906+
>
907+
<span
908+
aria-hidden="true"
909+
class="nhsuk-table-responsive__heading"
910+
>
911+
Name
912+
</span>
913+
<a
914+
href="/preview-submitted-letter-template/3"
915+
>
916+
Template 3
917+
</a>
918+
</td>
919+
<td
920+
class="nhsuk-table__cell"
921+
role="cell"
922+
>
923+
<span
924+
aria-hidden="true"
925+
class="nhsuk-table-responsive__heading"
926+
>
927+
Type
928+
</span>
929+
Standard letter - French
930+
</td>
931+
<td
932+
class="nhsuk-table__cell"
933+
role="cell"
934+
>
935+
<span
936+
aria-hidden="true"
937+
class="nhsuk-table-responsive__heading"
938+
>
939+
Status
940+
</span>
941+
<strong
942+
class="nhsuk-tag nhsuk-tag--grey"
943+
>
944+
Submitted
945+
</strong>
946+
</td>
947+
<td
948+
class="nhsuk-table__cell"
949+
role="cell"
950+
>
951+
<span
952+
aria-hidden="true"
953+
class="nhsuk-table-responsive__heading"
954+
>
955+
Date created
956+
</span>
957+
1st Feb 2021
958+
<br />
959+
00:00
960+
</td>
961+
<td
962+
class="nhsuk-table__cell"
963+
role="cell"
964+
>
965+
<span
966+
aria-hidden="true"
967+
class="nhsuk-table-responsive__heading"
968+
>
969+
Action
970+
</span>
971+
<div
972+
class="actionLinksWrapper"
973+
/>
974+
</td>
975+
</tr>
976+
</tbody>
977+
</table>
978+
</div>
979+
</div>
980+
</DocumentFragment>
981+
`;
982+
671983
exports[`MessageTemplates component matches snapshot with submitted status 1`] = `
672984
<DocumentFragment>
673985
<div

frontend/src/__tests__/components/organisms/PreviewLetterTemplate.test.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,32 @@ describe('PreviewLetterTemplate component', () => {
5555
expect(container.asFragment()).toMatchSnapshot();
5656
});
5757

58+
it('matches snapshot when template status is WAITING_FOR_PROOF', () => {
59+
const container = render(
60+
<PreviewLetterTemplate
61+
template={{
62+
id: '53525D03-1BC1-4563-ABF9-A74FF04142AF',
63+
name: 'letter',
64+
templateType: 'LETTER',
65+
templateStatus: 'WAITING_FOR_PROOF',
66+
letterType: 'q4',
67+
language: 'ar',
68+
files: {
69+
pdfTemplate: {
70+
fileName: 'file.pdf',
71+
currentVersion: 'a',
72+
virusScanStatus: 'PASSED',
73+
},
74+
},
75+
createdAt: '2025-04-02T09:33:25.729Z',
76+
updatedAt: '2025-04-02T09:33:25.729Z',
77+
}}
78+
/>
79+
);
80+
81+
expect(container.asFragment()).toMatchSnapshot();
82+
});
83+
5884
it('matches snapshot when template status is NOT_YET_SUBMITTED', () => {
5985
const container = render(
6086
<PreviewLetterTemplate

0 commit comments

Comments
 (0)