Skip to content

Commit f7a29f0

Browse files
authored
CCM-11457: change Not yet submitted to Draft in the UI for digital channels (#689)
1 parent fd97d66 commit f7a29f0

File tree

14 files changed

+745
-164
lines changed

14 files changed

+745
-164
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ exports[`Preview email form renders Client-side validation triggers 1`] = `
101101
class="nhsuk-summary-list__value"
102102
>
103103
<strong
104-
class="nhsuk-tag"
104+
class="nhsuk-tag nhsuk-tag--green"
105105
data-test-id="status-tag-not-yet-submitted"
106106
>
107-
Not yet submitted
107+
Draft
108108
</strong>
109109
</dd>
110110
</div>
@@ -377,10 +377,10 @@ exports[`Preview email form renders matches error snapshot 1`] = `
377377
class="nhsuk-summary-list__value"
378378
>
379379
<strong
380-
class="nhsuk-tag"
380+
class="nhsuk-tag nhsuk-tag--green"
381381
data-test-id="status-tag-not-yet-submitted"
382382
>
383-
Not yet submitted
383+
Draft
384384
</strong>
385385
</dd>
386386
</div>
@@ -626,10 +626,10 @@ exports[`Preview email form renders matches snapshot when navigating from edit s
626626
class="nhsuk-summary-list__value"
627627
>
628628
<strong
629-
class="nhsuk-tag"
629+
class="nhsuk-tag nhsuk-tag--green"
630630
data-test-id="status-tag-not-yet-submitted"
631631
>
632-
Not yet submitted
632+
Draft
633633
</strong>
634634
</dd>
635635
</div>
@@ -858,10 +858,10 @@ exports[`Preview email form renders matches snapshot when navigating from manage
858858
class="nhsuk-summary-list__value"
859859
>
860860
<strong
861-
class="nhsuk-tag"
861+
class="nhsuk-tag nhsuk-tag--green"
862862
data-test-id="status-tag-not-yet-submitted"
863863
>
864-
Not yet submitted
864+
Draft
865865
</strong>
866866
</dd>
867867
</div>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ exports[`Preview nhs app form renders Client-side validation triggers 1`] = `
101101
class="nhsuk-summary-list__value"
102102
>
103103
<strong
104-
class="nhsuk-tag"
104+
class="nhsuk-tag nhsuk-tag--green"
105105
data-test-id="status-tag-not-yet-submitted"
106106
>
107-
Not yet submitted
107+
Draft
108108
</strong>
109109
</dd>
110110
</div>
@@ -352,10 +352,10 @@ exports[`Preview nhs app form renders matches error snapshot 1`] = `
352352
class="nhsuk-summary-list__value"
353353
>
354354
<strong
355-
class="nhsuk-tag"
355+
class="nhsuk-tag nhsuk-tag--green"
356356
data-test-id="status-tag-not-yet-submitted"
357357
>
358-
Not yet submitted
358+
Draft
359359
</strong>
360360
</dd>
361361
</div>
@@ -576,10 +576,10 @@ exports[`Preview nhs app form renders matches snapshot when navigating from edit
576576
class="nhsuk-summary-list__value"
577577
>
578578
<strong
579-
class="nhsuk-tag"
579+
class="nhsuk-tag nhsuk-tag--green"
580580
data-test-id="status-tag-not-yet-submitted"
581581
>
582-
Not yet submitted
582+
Draft
583583
</strong>
584584
</dd>
585585
</div>
@@ -783,10 +783,10 @@ exports[`Preview nhs app form renders matches snapshot when navigating from mana
783783
class="nhsuk-summary-list__value"
784784
>
785785
<strong
786-
class="nhsuk-tag"
786+
class="nhsuk-tag nhsuk-tag--green"
787787
data-test-id="status-tag-not-yet-submitted"
788788
>
789-
Not yet submitted
789+
Draft
790790
</strong>
791791
</dd>
792792
</div>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ exports[`Review sms form renders Client-side validation triggers 1`] = `
101101
class="nhsuk-summary-list__value"
102102
>
103103
<strong
104-
class="nhsuk-tag"
104+
class="nhsuk-tag nhsuk-tag--green"
105105
data-test-id="status-tag-not-yet-submitted"
106106
>
107-
Not yet submitted
107+
Draft
108108
</strong>
109109
</dd>
110110
</div>
@@ -352,10 +352,10 @@ exports[`Review sms form renders matches error snapshot 1`] = `
352352
class="nhsuk-summary-list__value"
353353
>
354354
<strong
355-
class="nhsuk-tag"
355+
class="nhsuk-tag nhsuk-tag--green"
356356
data-test-id="status-tag-not-yet-submitted"
357357
>
358-
Not yet submitted
358+
Draft
359359
</strong>
360360
</dd>
361361
</div>
@@ -576,10 +576,10 @@ exports[`Review sms form renders matches snapshot when navigating from edit scre
576576
class="nhsuk-summary-list__value"
577577
>
578578
<strong
579-
class="nhsuk-tag"
579+
class="nhsuk-tag nhsuk-tag--green"
580580
data-test-id="status-tag-not-yet-submitted"
581581
>
582-
Not yet submitted
582+
Draft
583583
</strong>
584584
</dd>
585585
</div>
@@ -783,10 +783,10 @@ exports[`Review sms form renders matches snapshot when navigating from manage te
783783
class="nhsuk-summary-list__value"
784784
>
785785
<strong
786-
class="nhsuk-tag"
786+
class="nhsuk-tag nhsuk-tag--green"
787787
data-test-id="status-tag-not-yet-submitted"
788788
>
789-
Not yet submitted
789+
Draft
790790
</strong>
791791
</dd>
792792
</div>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ const messageTemplatesProps: {
3434
name: 'Template 3',
3535
createdAt: '2021-02-01T00:00:00.000Z',
3636
letterType: 'x0',
37+
language: 'en',
38+
updatedAt: '2021-02-01T00:00:00.000Z',
39+
files: {
40+
pdfTemplate: {
41+
fileName: 'template.pdf',
42+
currentVersion: '8BAC',
43+
virusScanStatus: 'PASSED',
44+
},
45+
},
46+
},
47+
{
48+
id: '4',
49+
templateType: 'LETTER',
50+
templateStatus: 'NOT_YET_SUBMITTED',
51+
name: 'Template 4',
52+
createdAt: '2021-02-01T00:00:00.000Z',
53+
letterType: 'x0',
3754
language: 'fr',
3855
updatedAt: '2021-02-01T00:00:00.000Z',
3956
files: {

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,30 @@ describe('PreviewTemplateDetailsLetter', () => {
201201

202202
expect(container.asFragment()).toMatchSnapshot();
203203
});
204+
205+
it('if status is NOT_YET_SUBMITTED, then Not yet submitted is displayed', () => {
206+
const container = render(
207+
<PreviewTemplateDetailsLetter
208+
template={{
209+
id: 'template-id',
210+
name: 'Example letter',
211+
templateStatus: 'NOT_YET_SUBMITTED',
212+
templateType: 'LETTER',
213+
letterType: 'x0',
214+
language: 'en',
215+
files: {
216+
pdfTemplate: {
217+
fileName: 'file.pdf',
218+
currentVersion: '4C728B7D-A028-4BA2-B180-A63CDD2AE1E9',
219+
virusScanStatus: 'PASSED',
220+
},
221+
},
222+
createdAt: '2025-01-13T10:19:25.579Z',
223+
updatedAt: '2025-01-13T10:19:25.579Z',
224+
}}
225+
/>
226+
);
227+
228+
expect(container.asFragment()).toMatchSnapshot();
229+
});
204230
});

0 commit comments

Comments
 (0)