@newskit-render/core 1.34.0 → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +38 -41
- package/components/{404/404.tsx → ErrorPage/ErrorPage.tsx} +10 -6
- package/components/article/__tests__/index.test.tsx +2 -2
- package/components/article/index.tsx +5 -3
- package/components/header/index.tsx +7 -3
- package/components/section/__tests__/ArticleSlice.test.tsx +9 -8
- package/components/section/__tests__/sectionUtils.test.ts +12 -9
- package/components/section/layouts/__tests__/Lead.test.tsx +2 -1
- package/components/section/layouts/__tests__/SectionRow.test.tsx +6 -5
- package/components/section/layouts/__tests__/__snapshots__/SectionRow.test.tsx.snap +143 -58
- package/components/section/sectionUtils.ts +6 -6
- package/cypress/e2e/account/account-subscription.spec.js +222 -0
- package/cypress/e2e/account/payment-failer.spec.js +137 -0
- package/cypress/support/commands.js +28 -3
- package/helpers/global-types.ts +2 -2
- package/helpers/mocks/getPageMock.ts +57 -33
- package/infrastructure/.circleci/config.yml +2 -2
- package/package.json +6 -6
- package/pages/[section]/index.tsx +18 -7
- package/pages/_error.tsx +18 -2
- package/public/MyAccount/pending-activation.svg +16 -0
- package/queries/getPage.ts +1 -1
- package/temp/header.tsx +7 -3
|
@@ -625,7 +625,27 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
.emotion-
|
|
628
|
+
.emotion-46 {
|
|
629
|
+
position: relative;
|
|
630
|
+
width: 100%;
|
|
631
|
+
display: block;
|
|
632
|
+
padding-top: 0;
|
|
633
|
+
height: auto;
|
|
634
|
+
width: 100%;
|
|
635
|
+
border-radius: 0;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.emotion-47 {
|
|
639
|
+
opacity: 1;
|
|
640
|
+
display: block;
|
|
641
|
+
border-radius: inherit;
|
|
642
|
+
height: auto;
|
|
643
|
+
width: 100%;
|
|
644
|
+
-webkit-animation: fadeIn 300ms;
|
|
645
|
+
animation: fadeIn 300ms;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
.emotion-68 {
|
|
629
649
|
border-style: solid;
|
|
630
650
|
border-color: #DEDEDE;
|
|
631
651
|
border-width: 1px;
|
|
@@ -731,7 +751,7 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
731
751
|
<img
|
|
732
752
|
alt="image alt"
|
|
733
753
|
class="emotion-22"
|
|
734
|
-
src="
|
|
754
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
735
755
|
/>
|
|
736
756
|
</picture>
|
|
737
757
|
</div>
|
|
@@ -787,7 +807,7 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
787
807
|
<img
|
|
788
808
|
alt="image alt 2"
|
|
789
809
|
class="emotion-22"
|
|
790
|
-
src="
|
|
810
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
791
811
|
/>
|
|
792
812
|
</picture>
|
|
793
813
|
</div>
|
|
@@ -835,15 +855,12 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
835
855
|
class="emotion-19"
|
|
836
856
|
>
|
|
837
857
|
<picture
|
|
838
|
-
class="emotion-
|
|
858
|
+
class="emotion-46"
|
|
839
859
|
>
|
|
840
|
-
<div
|
|
841
|
-
class="emotion-21"
|
|
842
|
-
/>
|
|
843
860
|
<img
|
|
844
|
-
alt="
|
|
845
|
-
class="emotion-
|
|
846
|
-
src="
|
|
861
|
+
alt=""
|
|
862
|
+
class="emotion-47"
|
|
863
|
+
src=""
|
|
847
864
|
/>
|
|
848
865
|
</picture>
|
|
849
866
|
</div>
|
|
@@ -899,7 +916,7 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
899
916
|
<img
|
|
900
917
|
alt="image alt 3"
|
|
901
918
|
class="emotion-22"
|
|
902
|
-
src="
|
|
919
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
903
920
|
/>
|
|
904
921
|
</picture>
|
|
905
922
|
</div>
|
|
@@ -941,7 +958,7 @@ exports[`SectionRow SectionRow alternative titlebar 1`] = `
|
|
|
941
958
|
</div>
|
|
942
959
|
<hr
|
|
943
960
|
aria-hidden="true"
|
|
944
|
-
class="emotion-
|
|
961
|
+
class="emotion-68"
|
|
945
962
|
data-testid="divider"
|
|
946
963
|
/>
|
|
947
964
|
</div>
|
|
@@ -1573,7 +1590,27 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1573
1590
|
}
|
|
1574
1591
|
}
|
|
1575
1592
|
|
|
1576
|
-
.emotion-
|
|
1593
|
+
.emotion-46 {
|
|
1594
|
+
position: relative;
|
|
1595
|
+
width: 100%;
|
|
1596
|
+
display: block;
|
|
1597
|
+
padding-top: 0;
|
|
1598
|
+
height: auto;
|
|
1599
|
+
width: 100%;
|
|
1600
|
+
border-radius: 0;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
.emotion-47 {
|
|
1604
|
+
opacity: 1;
|
|
1605
|
+
display: block;
|
|
1606
|
+
border-radius: inherit;
|
|
1607
|
+
height: auto;
|
|
1608
|
+
width: 100%;
|
|
1609
|
+
-webkit-animation: fadeIn 300ms;
|
|
1610
|
+
animation: fadeIn 300ms;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.emotion-68 {
|
|
1577
1614
|
border-style: solid;
|
|
1578
1615
|
border-color: #DEDEDE;
|
|
1579
1616
|
border-width: 1px;
|
|
@@ -1679,7 +1716,7 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1679
1716
|
<img
|
|
1680
1717
|
alt="image alt"
|
|
1681
1718
|
class="emotion-22"
|
|
1682
|
-
src="
|
|
1719
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
1683
1720
|
/>
|
|
1684
1721
|
</picture>
|
|
1685
1722
|
</div>
|
|
@@ -1735,7 +1772,7 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1735
1772
|
<img
|
|
1736
1773
|
alt="image alt 2"
|
|
1737
1774
|
class="emotion-22"
|
|
1738
|
-
src="
|
|
1775
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
1739
1776
|
/>
|
|
1740
1777
|
</picture>
|
|
1741
1778
|
</div>
|
|
@@ -1783,15 +1820,12 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1783
1820
|
class="emotion-19"
|
|
1784
1821
|
>
|
|
1785
1822
|
<picture
|
|
1786
|
-
class="emotion-
|
|
1823
|
+
class="emotion-46"
|
|
1787
1824
|
>
|
|
1788
|
-
<div
|
|
1789
|
-
class="emotion-21"
|
|
1790
|
-
/>
|
|
1791
1825
|
<img
|
|
1792
|
-
alt="
|
|
1793
|
-
class="emotion-
|
|
1794
|
-
src="
|
|
1826
|
+
alt=""
|
|
1827
|
+
class="emotion-47"
|
|
1828
|
+
src=""
|
|
1795
1829
|
/>
|
|
1796
1830
|
</picture>
|
|
1797
1831
|
</div>
|
|
@@ -1847,7 +1881,7 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1847
1881
|
<img
|
|
1848
1882
|
alt="image alt 3"
|
|
1849
1883
|
class="emotion-22"
|
|
1850
|
-
src="
|
|
1884
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
1851
1885
|
/>
|
|
1852
1886
|
</picture>
|
|
1853
1887
|
</div>
|
|
@@ -1889,7 +1923,7 @@ exports[`SectionRow SectionRow isDarkBackground 1`] = `
|
|
|
1889
1923
|
</div>
|
|
1890
1924
|
<hr
|
|
1891
1925
|
aria-hidden="true"
|
|
1892
|
-
class="emotion-
|
|
1926
|
+
class="emotion-68"
|
|
1893
1927
|
data-testid="divider"
|
|
1894
1928
|
/>
|
|
1895
1929
|
</div>
|
|
@@ -2521,7 +2555,27 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2521
2555
|
}
|
|
2522
2556
|
}
|
|
2523
2557
|
|
|
2524
|
-
.emotion-
|
|
2558
|
+
.emotion-46 {
|
|
2559
|
+
position: relative;
|
|
2560
|
+
width: 100%;
|
|
2561
|
+
display: block;
|
|
2562
|
+
padding-top: 0;
|
|
2563
|
+
height: auto;
|
|
2564
|
+
width: 100%;
|
|
2565
|
+
border-radius: 0;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
.emotion-47 {
|
|
2569
|
+
opacity: 1;
|
|
2570
|
+
display: block;
|
|
2571
|
+
border-radius: inherit;
|
|
2572
|
+
height: auto;
|
|
2573
|
+
width: 100%;
|
|
2574
|
+
-webkit-animation: fadeIn 300ms;
|
|
2575
|
+
animation: fadeIn 300ms;
|
|
2576
|
+
}
|
|
2577
|
+
|
|
2578
|
+
.emotion-68 {
|
|
2525
2579
|
border-style: solid;
|
|
2526
2580
|
border-color: #DEDEDE;
|
|
2527
2581
|
border-width: 1px;
|
|
@@ -2627,7 +2681,7 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2627
2681
|
<img
|
|
2628
2682
|
alt="image alt"
|
|
2629
2683
|
class="emotion-22"
|
|
2630
|
-
src="
|
|
2684
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
2631
2685
|
/>
|
|
2632
2686
|
</picture>
|
|
2633
2687
|
</div>
|
|
@@ -2683,7 +2737,7 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2683
2737
|
<img
|
|
2684
2738
|
alt="image alt 2"
|
|
2685
2739
|
class="emotion-22"
|
|
2686
|
-
src="
|
|
2740
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
2687
2741
|
/>
|
|
2688
2742
|
</picture>
|
|
2689
2743
|
</div>
|
|
@@ -2731,15 +2785,12 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2731
2785
|
class="emotion-19"
|
|
2732
2786
|
>
|
|
2733
2787
|
<picture
|
|
2734
|
-
class="emotion-
|
|
2788
|
+
class="emotion-46"
|
|
2735
2789
|
>
|
|
2736
|
-
<div
|
|
2737
|
-
class="emotion-21"
|
|
2738
|
-
/>
|
|
2739
2790
|
<img
|
|
2740
|
-
alt="
|
|
2741
|
-
class="emotion-
|
|
2742
|
-
src="
|
|
2791
|
+
alt=""
|
|
2792
|
+
class="emotion-47"
|
|
2793
|
+
src=""
|
|
2743
2794
|
/>
|
|
2744
2795
|
</picture>
|
|
2745
2796
|
</div>
|
|
@@ -2795,7 +2846,7 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2795
2846
|
<img
|
|
2796
2847
|
alt="image alt 3"
|
|
2797
2848
|
class="emotion-22"
|
|
2798
|
-
src="
|
|
2849
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
2799
2850
|
/>
|
|
2800
2851
|
</picture>
|
|
2801
2852
|
</div>
|
|
@@ -2837,7 +2888,7 @@ exports[`SectionRow SectionRow with title 1`] = `
|
|
|
2837
2888
|
</div>
|
|
2838
2889
|
<hr
|
|
2839
2890
|
aria-hidden="true"
|
|
2840
|
-
class="emotion-
|
|
2891
|
+
class="emotion-68"
|
|
2841
2892
|
data-testid="divider"
|
|
2842
2893
|
/>
|
|
2843
2894
|
</div>
|
|
@@ -3485,6 +3536,26 @@ exports[`SectionRow SectionRow without extra space 1`] = `
|
|
|
3485
3536
|
}
|
|
3486
3537
|
}
|
|
3487
3538
|
|
|
3539
|
+
.emotion-48 {
|
|
3540
|
+
position: relative;
|
|
3541
|
+
width: 100%;
|
|
3542
|
+
display: block;
|
|
3543
|
+
padding-top: 0;
|
|
3544
|
+
height: auto;
|
|
3545
|
+
width: 100%;
|
|
3546
|
+
border-radius: 0;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
.emotion-49 {
|
|
3550
|
+
opacity: 1;
|
|
3551
|
+
display: block;
|
|
3552
|
+
border-radius: inherit;
|
|
3553
|
+
height: auto;
|
|
3554
|
+
width: 100%;
|
|
3555
|
+
-webkit-animation: fadeIn 300ms;
|
|
3556
|
+
animation: fadeIn 300ms;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3488
3559
|
<div
|
|
3489
3560
|
class="emotion-0"
|
|
3490
3561
|
>
|
|
@@ -3589,7 +3660,7 @@ exports[`SectionRow SectionRow without extra space 1`] = `
|
|
|
3589
3660
|
<img
|
|
3590
3661
|
alt="image alt"
|
|
3591
3662
|
class="emotion-24"
|
|
3592
|
-
src="
|
|
3663
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
3593
3664
|
/>
|
|
3594
3665
|
</picture>
|
|
3595
3666
|
</div>
|
|
@@ -3645,7 +3716,7 @@ exports[`SectionRow SectionRow without extra space 1`] = `
|
|
|
3645
3716
|
<img
|
|
3646
3717
|
alt="image alt 2"
|
|
3647
3718
|
class="emotion-24"
|
|
3648
|
-
src="
|
|
3719
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
3649
3720
|
/>
|
|
3650
3721
|
</picture>
|
|
3651
3722
|
</div>
|
|
@@ -3693,15 +3764,12 @@ exports[`SectionRow SectionRow without extra space 1`] = `
|
|
|
3693
3764
|
class="emotion-21"
|
|
3694
3765
|
>
|
|
3695
3766
|
<picture
|
|
3696
|
-
class="emotion-
|
|
3767
|
+
class="emotion-48"
|
|
3697
3768
|
>
|
|
3698
|
-
<div
|
|
3699
|
-
class="emotion-23"
|
|
3700
|
-
/>
|
|
3701
3769
|
<img
|
|
3702
|
-
alt="
|
|
3703
|
-
class="emotion-
|
|
3704
|
-
src="
|
|
3770
|
+
alt=""
|
|
3771
|
+
class="emotion-49"
|
|
3772
|
+
src=""
|
|
3705
3773
|
/>
|
|
3706
3774
|
</picture>
|
|
3707
3775
|
</div>
|
|
@@ -3757,7 +3825,7 @@ exports[`SectionRow SectionRow without extra space 1`] = `
|
|
|
3757
3825
|
<img
|
|
3758
3826
|
alt="image alt 3"
|
|
3759
3827
|
class="emotion-24"
|
|
3760
|
-
src="
|
|
3828
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
3761
3829
|
/>
|
|
3762
3830
|
</picture>
|
|
3763
3831
|
</div>
|
|
@@ -4195,7 +4263,27 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4195
4263
|
}
|
|
4196
4264
|
}
|
|
4197
4265
|
|
|
4198
|
-
.emotion-
|
|
4266
|
+
.emotion-33 {
|
|
4267
|
+
position: relative;
|
|
4268
|
+
width: 100%;
|
|
4269
|
+
display: block;
|
|
4270
|
+
padding-top: 0;
|
|
4271
|
+
height: auto;
|
|
4272
|
+
width: 100%;
|
|
4273
|
+
border-radius: 0;
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4276
|
+
.emotion-34 {
|
|
4277
|
+
opacity: 1;
|
|
4278
|
+
display: block;
|
|
4279
|
+
border-radius: inherit;
|
|
4280
|
+
height: auto;
|
|
4281
|
+
width: 100%;
|
|
4282
|
+
-webkit-animation: fadeIn 300ms;
|
|
4283
|
+
animation: fadeIn 300ms;
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
.emotion-55 {
|
|
4199
4287
|
border-style: solid;
|
|
4200
4288
|
border-color: #DEDEDE;
|
|
4201
4289
|
border-width: 1px;
|
|
@@ -4239,7 +4327,7 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4239
4327
|
<img
|
|
4240
4328
|
alt="image alt"
|
|
4241
4329
|
class="emotion-9"
|
|
4242
|
-
src="
|
|
4330
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
4243
4331
|
/>
|
|
4244
4332
|
</picture>
|
|
4245
4333
|
</div>
|
|
@@ -4295,7 +4383,7 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4295
4383
|
<img
|
|
4296
4384
|
alt="image alt 2"
|
|
4297
4385
|
class="emotion-9"
|
|
4298
|
-
src="
|
|
4386
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
4299
4387
|
/>
|
|
4300
4388
|
</picture>
|
|
4301
4389
|
</div>
|
|
@@ -4343,15 +4431,12 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4343
4431
|
class="emotion-6"
|
|
4344
4432
|
>
|
|
4345
4433
|
<picture
|
|
4346
|
-
class="emotion-
|
|
4434
|
+
class="emotion-33"
|
|
4347
4435
|
>
|
|
4348
|
-
<div
|
|
4349
|
-
class="emotion-8"
|
|
4350
|
-
/>
|
|
4351
4436
|
<img
|
|
4352
|
-
alt="
|
|
4353
|
-
class="emotion-
|
|
4354
|
-
src="
|
|
4437
|
+
alt=""
|
|
4438
|
+
class="emotion-34"
|
|
4439
|
+
src=""
|
|
4355
4440
|
/>
|
|
4356
4441
|
</picture>
|
|
4357
4442
|
</div>
|
|
@@ -4407,7 +4492,7 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4407
4492
|
<img
|
|
4408
4493
|
alt="image alt 3"
|
|
4409
4494
|
class="emotion-9"
|
|
4410
|
-
src="
|
|
4495
|
+
src="https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1"
|
|
4411
4496
|
/>
|
|
4412
4497
|
</picture>
|
|
4413
4498
|
</div>
|
|
@@ -4449,7 +4534,7 @@ exports[`SectionRow SectionRow without title 1`] = `
|
|
|
4449
4534
|
</div>
|
|
4450
4535
|
<hr
|
|
4451
4536
|
aria-hidden="true"
|
|
4452
|
-
class="emotion-
|
|
4537
|
+
class="emotion-55"
|
|
4453
4538
|
data-testid="divider"
|
|
4454
4539
|
/>
|
|
4455
4540
|
</div>
|
|
@@ -12,15 +12,15 @@ export const getMedia = (media?: Media) => {
|
|
|
12
12
|
loadingAspectRatio: '',
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return '
|
|
15
|
+
return 'crops' in media
|
|
16
16
|
? {
|
|
17
|
-
src: media?.
|
|
18
|
-
alt: media?.
|
|
19
|
-
loadingAspectRatio: media?.
|
|
17
|
+
src: media?.crops[0].url || '',
|
|
18
|
+
alt: media?.crops[0].alt || '',
|
|
19
|
+
loadingAspectRatio: media?.crops[0].aspectRatio || '',
|
|
20
20
|
}
|
|
21
21
|
: {
|
|
22
|
-
src: media
|
|
23
|
-
alt: media
|
|
22
|
+
src: media?.posterImage?.crop?.url || '',
|
|
23
|
+
alt: media?.posterImage?.crop?.alt || '',
|
|
24
24
|
loadingAspectRatio: media?.posterImage?.crop?.aspectRatio || '',
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
describe('Account Subscription & Cancellation', () => {
|
|
2
|
+
it('Should show no subscription view', () => {
|
|
3
|
+
cy.GetAcsSession('noSub')
|
|
4
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
5
|
+
cy.contains('You don’t have a subscription')
|
|
6
|
+
cy.contains('Start a subscription and get access to all benefits.')
|
|
7
|
+
cy.get('[data-testid="primary-button"]')
|
|
8
|
+
.should('have.attr', 'href', '/title-storefrount')
|
|
9
|
+
.contains('View subscription options')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('Should show Pending Activation view', () => {
|
|
13
|
+
cy.GetAcsSession('expiredSub')
|
|
14
|
+
cy.mockConsent()
|
|
15
|
+
cy.visit('/account/subscription-and-billing', {
|
|
16
|
+
onBeforeLoad: (win) => {
|
|
17
|
+
let nextData
|
|
18
|
+
|
|
19
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
20
|
+
set(o) {
|
|
21
|
+
// eslint-disable-next-line no-param-reassign
|
|
22
|
+
o.props.pageProps.user.subscriptions[0].status =
|
|
23
|
+
'Pending Activation'
|
|
24
|
+
nextData = o
|
|
25
|
+
},
|
|
26
|
+
get() {
|
|
27
|
+
return nextData
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
cy.contains('Your subscription is being activated')
|
|
33
|
+
cy.contains(
|
|
34
|
+
'Your membership is being set up at the moment, so you can’t access your subscription and billing details yet.'
|
|
35
|
+
)
|
|
36
|
+
cy.contains(
|
|
37
|
+
'Setting up your account can take a couple of hours, so please come back and try again later.'
|
|
38
|
+
)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('Should show expired subscription view', () => {
|
|
42
|
+
cy.GetAcsSession('expiredSub')
|
|
43
|
+
cy.mockConsent()
|
|
44
|
+
const date = new Date(Date.now() - 24 * 35 * 3600 * 1000)
|
|
45
|
+
cy.visit('/account/subscription-and-billing', {
|
|
46
|
+
onBeforeLoad: (win) => {
|
|
47
|
+
let nextData
|
|
48
|
+
|
|
49
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
50
|
+
set(o) {
|
|
51
|
+
// eslint-disable-next-line no-param-reassign
|
|
52
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
53
|
+
nextData = o
|
|
54
|
+
},
|
|
55
|
+
get() {
|
|
56
|
+
return nextData
|
|
57
|
+
},
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
cy.contains('You’ve previously had a subscription that has now expired')
|
|
63
|
+
|
|
64
|
+
cy.contains(
|
|
65
|
+
`On ${date.toLocaleDateString(
|
|
66
|
+
'en-GB'
|
|
67
|
+
)} your Digital subscription expired. You can can re-subscribe by confirming a few details or view other packages that are available.`
|
|
68
|
+
)
|
|
69
|
+
cy.get('[data-testid="primary-button"]')
|
|
70
|
+
.should('have.attr', 'href', '/title-re-subscribe')
|
|
71
|
+
.contains('Re-subscribe')
|
|
72
|
+
cy.get('[data-testid="secondary-button"]')
|
|
73
|
+
.should('have.attr', 'href', '/title-subscription-options')
|
|
74
|
+
.contains('View subscription options')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('should got through cancellation workflow', () => {
|
|
78
|
+
cy.GetAcsSession('withSub')
|
|
79
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
80
|
+
cy.contains('h1', 'Subscription & Billing')
|
|
81
|
+
cy.contains(
|
|
82
|
+
'All your subscription details, including payment info and transactions.'
|
|
83
|
+
)
|
|
84
|
+
cy.contains('4AAA038742030')
|
|
85
|
+
cy.contains('************1111')
|
|
86
|
+
cy.contains('expiry date 01/31')
|
|
87
|
+
|
|
88
|
+
cy.get('a[href="/account/cancellation"]').should('be.visible').click()
|
|
89
|
+
|
|
90
|
+
cy.get('[type="radio"]').first().check()
|
|
91
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
92
|
+
cy.contains('Are you sure you want to cancel your subscription?')
|
|
93
|
+
cy.contains(
|
|
94
|
+
'You will lose unlimited access to exclusive content and benefits.'
|
|
95
|
+
)
|
|
96
|
+
cy.contains(
|
|
97
|
+
'Your subscription full access will be revoked by the end of your current bill cycle.'
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
// mock sussesful cancellation
|
|
101
|
+
cy.intercept('POST', '/api/account/mutate', {
|
|
102
|
+
statusCode: 200,
|
|
103
|
+
body: { data: { cancelSubscription: { success: true } } },
|
|
104
|
+
})
|
|
105
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
106
|
+
cy.get('[data-testid="dialog-content"]').should('be.visible')
|
|
107
|
+
// go back to subscription and billing
|
|
108
|
+
cy.contains('Back to account').click()
|
|
109
|
+
cy.intercept('/account/subscription-and-billing')
|
|
110
|
+
// reload with correct mock data to show past banner
|
|
111
|
+
const date = new Date(Date.now() + 20 * 30 * 3600 * 1000)
|
|
112
|
+
cy.visit('/account/subscription-and-billing', {
|
|
113
|
+
onBeforeLoad: (win) => {
|
|
114
|
+
let nextData
|
|
115
|
+
|
|
116
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
117
|
+
set(o) {
|
|
118
|
+
// eslint-disable-next-line no-param-reassign
|
|
119
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
120
|
+
nextData = o
|
|
121
|
+
},
|
|
122
|
+
get() {
|
|
123
|
+
return nextData
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
129
|
+
cy.contains('Your subscription will end soon.')
|
|
130
|
+
cy.contains(
|
|
131
|
+
`You have cancelled your subscription and will lose access to all benefits on ${date.getDate()}/${
|
|
132
|
+
date.getMonth() + 1
|
|
133
|
+
}/${date.getFullYear()}. To re-activate your subscription call XXXX-XXX-XXXX.`
|
|
134
|
+
)
|
|
135
|
+
cy.contains(
|
|
136
|
+
'If you change your mind or cancelled by mistake, speak to one of our advisors on XXXX-XXX-XXXX'
|
|
137
|
+
)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
it('Should show warning when you dont give a cancellation reason', () => {
|
|
141
|
+
cy.GetAcsSession('withSub')
|
|
142
|
+
cy.mockConsentAndVisit('/account/cancellation')
|
|
143
|
+
cy.contains('Please tell us why you want to cancel')
|
|
144
|
+
cy.contains(
|
|
145
|
+
'We value your opinion and this information will help us understand how we can improve our product and the services we provide.'
|
|
146
|
+
)
|
|
147
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
148
|
+
cy.contains('Please, select one option')
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
it('Should display textfield for other', () => {
|
|
152
|
+
cy.GetAcsSession('withSub')
|
|
153
|
+
cy.mockConsentAndVisit('/account/cancellation')
|
|
154
|
+
cy.contains('Please tell us why you want to cancel')
|
|
155
|
+
cy.get('[type="radio"]').check('Other')
|
|
156
|
+
cy.get('input[name="extra"]').clear().type('Thanks my buisness')
|
|
157
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView().click()
|
|
158
|
+
cy.contains('Are you sure you want to cancel your subscription?')
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
it('Should not show banner once it has been dismissed', () => {
|
|
162
|
+
cy.GetAcsSession('withSub')
|
|
163
|
+
cy.mockConsent()
|
|
164
|
+
const date = new Date(Date.now() + 20 * 30 * 3600 * 1000)
|
|
165
|
+
cy.visit('/account/subscription-and-billing', {
|
|
166
|
+
onBeforeLoad: (win) => {
|
|
167
|
+
let nextData
|
|
168
|
+
|
|
169
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
170
|
+
set(o) {
|
|
171
|
+
// eslint-disable-next-line no-param-reassign
|
|
172
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
173
|
+
nextData = o
|
|
174
|
+
},
|
|
175
|
+
get() {
|
|
176
|
+
return nextData
|
|
177
|
+
},
|
|
178
|
+
})
|
|
179
|
+
},
|
|
180
|
+
})
|
|
181
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
182
|
+
cy.contains('Your subscription will end soon.')
|
|
183
|
+
cy.get('[data-testid="close-banner"]').click({
|
|
184
|
+
force: true,
|
|
185
|
+
multiple: true,
|
|
186
|
+
})
|
|
187
|
+
cy.reload()
|
|
188
|
+
cy.get('[data-testid="banner-container"]').should('not.exist')
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
it('Should not display banner if set date is passed current date', () => {
|
|
192
|
+
cy.GetAcsSession('withSub')
|
|
193
|
+
cy.mockConsent()
|
|
194
|
+
const date = new Date(Date.now() - 24 * 35 * 3600 * 1000)
|
|
195
|
+
cy.visit('/account/subscription-and-billing', {
|
|
196
|
+
onBeforeLoad: (win) => {
|
|
197
|
+
let nextData
|
|
198
|
+
|
|
199
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
200
|
+
set(o) {
|
|
201
|
+
// eslint-disable-next-line no-param-reassign
|
|
202
|
+
o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
|
|
203
|
+
nextData = o
|
|
204
|
+
},
|
|
205
|
+
get() {
|
|
206
|
+
return nextData
|
|
207
|
+
},
|
|
208
|
+
})
|
|
209
|
+
},
|
|
210
|
+
})
|
|
211
|
+
cy.get('[data-testid="banner-container"]').should('be.visible')
|
|
212
|
+
cy.contains('Your subscription has been cancelled.').then(() => {
|
|
213
|
+
window.localStorage.setItem(
|
|
214
|
+
'cancelledBanner',
|
|
215
|
+
new Date(new Date().setDate(new Date().getDate() - 7)).toDateString()
|
|
216
|
+
)
|
|
217
|
+
})
|
|
218
|
+
cy.reload()
|
|
219
|
+
cy.get('[data-testid="banner-container"]').should('not.exist')
|
|
220
|
+
cy.clearLocalStorage()
|
|
221
|
+
})
|
|
222
|
+
})
|