Skip to content

Commit 4f6857f

Browse files
authored
CCM-10189: Add test-data-id to components and pages (#484)
1 parent 29f7743 commit 4f6857f

File tree

26 files changed

+157
-38
lines changed

26 files changed

+157
-38
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`ChooseATemplateTypePage - LETTER option is hidden when feature flag is
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
>
1213
<svg
@@ -165,6 +166,7 @@ exports[`ChooseATemplateTypePage 1`] = `
165166
>
166167
<a
167168
class="nhsuk-back-link__link"
169+
data-testid="back-to-templates-link"
168170
href="/templates/message-templates"
169171
>
170172
<svg

frontend/src/__tests__/app/create-and-submit-templates/__snapshots__/page.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ exports[`matches the snapshot 1`] = `
6666
<a
6767
aria-disabled="false"
6868
class="nhsuk-button"
69+
data-testid="start-now-button"
6970
draggable="false"
7071
href="/templates/message-templates"
7172
role="button"
@@ -141,6 +142,7 @@ exports[`matches the snapshot with letters feature flag disabled 1`] = `
141142
<a
142143
aria-disabled="false"
143144
class="nhsuk-button"
145+
data-testid="start-now-button"
144146
draggable="false"
145147
href="/templates/message-templates"
146148
role="button"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Choose template page Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
>
1213
<svg
@@ -220,6 +221,7 @@ exports[`Choose template page renders error component 1`] = `
220221
>
221222
<a
222223
class="nhsuk-back-link__link"
224+
data-testid="back-to-templates-link"
223225
href="/templates/message-templates"
224226
>
225227
<svg
@@ -422,6 +424,7 @@ exports[`Choose template page selects one radio button at a time 1`] = `
422424
>
423425
<a
424426
class="nhsuk-back-link__link"
427+
data-testid="back-to-templates-link"
425428
href="/templates/message-templates"
426429
>
427430
<svg

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Choose template page Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
id="back-link"
1213
>
@@ -202,6 +203,7 @@ exports[`Choose template page renders error component 1`] = `
202203
>
203204
<a
204205
class="nhsuk-back-link__link"
206+
data-testid="back-to-templates-link"
205207
href="/templates/message-templates"
206208
id="back-link"
207209
>
@@ -386,6 +388,7 @@ exports[`Choose template page selects one radio button at a time 1`] = `
386388
>
387389
<a
388390
class="nhsuk-back-link__link"
391+
data-testid="back-to-templates-link"
389392
href="/templates/message-templates"
390393
id="back-link"
391394
>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ exports[`renders component correctly 1`] = `
4040
<button
4141
aria-disabled="false"
4242
class="nhsuk-button nhsuk-button--secondary"
43+
data-testid="back-to-templates-link"
4344
type="submit"
4445
>
4546
No, go back
@@ -64,6 +65,7 @@ exports[`renders component correctly 1`] = `
6465
<button
6566
aria-disabled="false"
6667
class="nhsuk-button nhsuk-button--warning"
68+
data-testid="delete-template-button"
6769
type="submit"
6870
>
6971
Yes, delete template

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ exports[`renders page one error 1`] = `
630630
>
631631
<a
632632
class="nhsuk-back-link__link"
633+
data-testid="back-to-templates-link"
633634
href="/templates/choose-a-template-type"
634635
>
635636
<svg
@@ -1322,6 +1323,7 @@ exports[`renders page with multiple errors 1`] = `
13221323
>
13231324
<a
13241325
class="nhsuk-back-link__link"
1326+
data-testid="back-to-templates-link"
13251327
href="/templates/choose-a-template-type"
13261328
>
13271329
<svg
@@ -2044,6 +2046,7 @@ exports[`renders page with preloaded field values 1`] = `
20442046
>
20452047
<a
20462048
class="nhsuk-back-link__link"
2049+
data-testid="back-to-templates-link"
20472050
href="/templates/choose-a-template-type"
20482051
>
20492052
<svg

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/choose-a-template-type"
1112
>
1213
<svg
@@ -483,6 +484,7 @@ exports[`renders page one error 1`] = `
483484
>
484485
<a
485486
class="nhsuk-back-link__link"
487+
data-testid="back-to-templates-link"
486488
href="/templates/choose-a-template-type"
487489
>
488490
<svg
@@ -965,6 +967,7 @@ exports[`renders page with multiple errors 1`] = `
965967
>
966968
<a
967969
class="nhsuk-back-link__link"
970+
data-testid="back-to-templates-link"
968971
href="/templates/choose-a-template-type"
969972
>
970973
<svg
@@ -1483,6 +1486,7 @@ exports[`renders page with preloaded field values 1`] = `
14831486
>
14841487
<a
14851488
class="nhsuk-back-link__link"
1489+
data-testid="back-to-templates-link"
14861490
href="/templates/choose-a-template-type"
14871491
>
14881492
<svg

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Preview email form renders Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
id="back-link"
1213
>
@@ -276,6 +277,7 @@ exports[`Preview email form renders Client-side validation triggers 1`] = `
276277
</form>
277278
<p>
278279
<a
280+
data-testid="back-to-templates-link-bottom"
279281
href="/message-templates"
280282
>
281283
Back to all templates
@@ -294,6 +296,7 @@ exports[`Preview email form renders matches error snapshot 1`] = `
294296
>
295297
<a
296298
class="nhsuk-back-link__link"
299+
data-testid="back-to-templates-link"
297300
href="/templates/message-templates"
298301
id="back-link"
299302
>
@@ -561,6 +564,7 @@ exports[`Preview email form renders matches error snapshot 1`] = `
561564
</form>
562565
<p>
563566
<a
567+
data-testid="back-to-templates-link-bottom"
564568
href="/message-templates"
565569
>
566570
Back to all templates
@@ -579,6 +583,7 @@ exports[`Preview email form renders matches snapshot when navigating from edit s
579583
>
580584
<a
581585
class="nhsuk-back-link__link"
586+
data-testid="back-to-templates-link"
582587
href="/templates/message-templates"
583588
id="back-link"
584589
>
@@ -809,6 +814,7 @@ exports[`Preview email form renders matches snapshot when navigating from edit s
809814
</form>
810815
<p>
811816
<a
817+
data-testid="back-to-templates-link-bottom"
812818
href="/message-templates"
813819
>
814820
Back to all templates
@@ -827,6 +833,7 @@ exports[`Preview email form renders matches snapshot when navigating from manage
827833
>
828834
<a
829835
class="nhsuk-back-link__link"
836+
data-testid="back-to-templates-link"
830837
href="/templates/message-templates"
831838
id="back-link"
832839
>
@@ -1052,6 +1059,7 @@ exports[`Preview email form renders matches snapshot when navigating from manage
10521059
</form>
10531060
<p>
10541061
<a
1062+
data-testid="back-to-templates-link-bottom"
10551063
href="/message-templates"
10561064
>
10571065
Back to all templates

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Preview nhs app form renders Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
id="back-link"
1213
>
@@ -251,6 +252,7 @@ exports[`Preview nhs app form renders Client-side validation triggers 1`] = `
251252
</form>
252253
<p>
253254
<a
255+
data-testid="back-to-templates-link-bottom"
254256
href="/message-templates"
255257
>
256258
Back to all templates
@@ -269,6 +271,7 @@ exports[`Preview nhs app form renders matches error snapshot 1`] = `
269271
>
270272
<a
271273
class="nhsuk-back-link__link"
274+
data-testid="back-to-templates-link"
272275
href="/templates/message-templates"
273276
id="back-link"
274277
>
@@ -511,6 +514,7 @@ exports[`Preview nhs app form renders matches error snapshot 1`] = `
511514
</form>
512515
<p>
513516
<a
517+
data-testid="back-to-templates-link-bottom"
514518
href="/message-templates"
515519
>
516520
Back to all templates
@@ -529,6 +533,7 @@ exports[`Preview nhs app form renders matches snapshot when navigating from edit
529533
>
530534
<a
531535
class="nhsuk-back-link__link"
536+
data-testid="back-to-templates-link"
532537
href="/templates/message-templates"
533538
id="back-link"
534539
>
@@ -734,6 +739,7 @@ exports[`Preview nhs app form renders matches snapshot when navigating from edit
734739
</form>
735740
<p>
736741
<a
742+
data-testid="back-to-templates-link-bottom"
737743
href="/message-templates"
738744
>
739745
Back to all templates
@@ -752,6 +758,7 @@ exports[`Preview nhs app form renders matches snapshot when navigating from mana
752758
>
753759
<a
754760
class="nhsuk-back-link__link"
761+
data-testid="back-to-templates-link"
755762
href="/templates/message-templates"
756763
id="back-link"
757764
>
@@ -952,6 +959,7 @@ exports[`Preview nhs app form renders matches snapshot when navigating from mana
952959
</form>
953960
<p>
954961
<a
962+
data-testid="back-to-templates-link-bottom"
955963
href="/message-templates"
956964
>
957965
Back to all templates

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ exports[`Review sms form renders Client-side validation triggers 1`] = `
77
>
88
<a
99
class="nhsuk-back-link__link"
10+
data-testid="back-to-templates-link"
1011
href="/templates/message-templates"
1112
id="back-link"
1213
>
@@ -251,6 +252,7 @@ exports[`Review sms form renders Client-side validation triggers 1`] = `
251252
</form>
252253
<p>
253254
<a
255+
data-testid="back-to-templates-link-bottom"
254256
href="/message-templates"
255257
>
256258
Back to all templates
@@ -269,6 +271,7 @@ exports[`Review sms form renders matches error snapshot 1`] = `
269271
>
270272
<a
271273
class="nhsuk-back-link__link"
274+
data-testid="back-to-templates-link"
272275
href="/templates/message-templates"
273276
id="back-link"
274277
>
@@ -511,6 +514,7 @@ exports[`Review sms form renders matches error snapshot 1`] = `
511514
</form>
512515
<p>
513516
<a
517+
data-testid="back-to-templates-link-bottom"
514518
href="/message-templates"
515519
>
516520
Back to all templates
@@ -529,6 +533,7 @@ exports[`Review sms form renders matches snapshot when navigating from edit scre
529533
>
530534
<a
531535
class="nhsuk-back-link__link"
536+
data-testid="back-to-templates-link"
532537
href="/templates/message-templates"
533538
id="back-link"
534539
>
@@ -734,6 +739,7 @@ exports[`Review sms form renders matches snapshot when navigating from edit scre
734739
</form>
735740
<p>
736741
<a
742+
data-testid="back-to-templates-link-bottom"
737743
href="/message-templates"
738744
>
739745
Back to all templates
@@ -752,6 +758,7 @@ exports[`Review sms form renders matches snapshot when navigating from manage te
752758
>
753759
<a
754760
class="nhsuk-back-link__link"
761+
data-testid="back-to-templates-link"
755762
href="/templates/message-templates"
756763
id="back-link"
757764
>
@@ -952,6 +959,7 @@ exports[`Review sms form renders matches snapshot when navigating from manage te
952959
</form>
953960
<p>
954961
<a
962+
data-testid="back-to-templates-link-bottom"
955963
href="/message-templates"
956964
>
957965
Back to all templates

0 commit comments

Comments
 (0)