@newskit-render/core 4.20.5-alpha.0 → 4.20.5

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.
@@ -662,6 +662,7 @@ describe('Personal detail edit pages', () => {
662
662
  expect(loc.pathname).to.eq('/account')
663
663
  })
664
664
  })
665
+
665
666
  it('Should change user address', () => {
666
667
  cy.get('a[href="/account/edit/address"]').should('be.visible').click()
667
668
 
@@ -699,6 +700,7 @@ describe('Personal detail edit pages', () => {
699
700
  'Your address was successfully updated'
700
701
  )
701
702
  })
703
+
702
704
  it.skip('Should search for address and automatically populate it', () => {
703
705
  cy.get('a[href="/account/edit/address"]').should('be.visible').click()
704
706
 
@@ -748,6 +750,7 @@ describe('Personal detail edit pages', () => {
748
750
  'Your address was successfully updated'
749
751
  )
750
752
  })
753
+
751
754
  it('Should show input validation error messages when user tries to add invalid address', () => {
752
755
  cy.get('a[href="/account/edit/address"]').should('be.visible').click()
753
756
 
@@ -772,7 +775,8 @@ describe('Personal detail edit pages', () => {
772
775
  'Updating your address...'
773
776
  ).should('not.exist')
774
777
  })
775
- it('Should show error toast when updating address if internal server error occures', () => {
778
+
779
+ it('Should show error toast when updating address and internal server error occures', () => {
776
780
  cy.intercept('POST', '/api/account/mutate', { statusCode: 500 })
777
781
 
778
782
  cy.get('a[href="/account/edit/address"]').should('be.visible').click()
@@ -793,7 +797,44 @@ describe('Personal detail edit pages', () => {
793
797
  )
794
798
  })
795
799
 
796
- it('Should show modal when postcode is outside delivery area and user has print subscription', () => {
800
+ it('Should show modal when selected country is not UK, Isle of Man, Guernsey or Jersey and user has print with vouchers subscription', () => {
801
+ cy.GetTnlAcsSession('printVouchers')
802
+ cy.mockConsentAndVisit('/account/edit/address')
803
+
804
+ cy.get('input[name="line1"]').clear().type('620 Atlantic Ave')
805
+ cy.get('input[name="line2"]').clear().type('Brooklyn')
806
+ cy.get('input[name="city"]').clear().type('New York')
807
+ cy.get('input[name="postcode"]').clear().type('11217')
808
+
809
+ cy.get('[data-testid="select-country"]').click()
810
+ cy.get('[data-testid="United Kingdom"]').should('be.visible')
811
+
812
+ cy.get('[data-testid="United States of America"]').click()
813
+
814
+ cy.contains('Save').click()
815
+
816
+ cy.get('[data-testid="modal"]')
817
+ .should('exist')
818
+ .should('have.length.of.at.most', 1)
819
+ cy.contains(
820
+ '[data-testid="introduction-title"]',
821
+ 'Address Outside Delivery Area'
822
+ ).should('exist')
823
+ cy.contains(
824
+ '[data-testid="description-block"]',
825
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
826
+ ).should('exist')
827
+ cy.contains('[data-testid="primary-button"]', 'Return to My Account')
828
+ .should('exist')
829
+ .click()
830
+ cy.contains(
831
+ '[data-testid="toast-container"]',
832
+ 'As your new address is outside of our delivery area it has not been updated.'
833
+ )
834
+ cy.url().should('eq', 'http://localhost:3000/account')
835
+ })
836
+
837
+ it('Should show modal when selected country is UK but postcode is outside delivery area and user has print subscription', () => {
797
838
  cy.GetTnlAcsSession('print')
798
839
  cy.mockConsentAndVisit('/account')
799
840
 
@@ -818,14 +859,15 @@ describe('Personal detail edit pages', () => {
818
859
  ).should('exist')
819
860
  cy.contains('[data-testid="primary-button"]', 'Return to My Account')
820
861
  .should('exist')
821
- .click({ multiple: true })
862
+ .click()
822
863
  cy.contains(
823
864
  '[data-testid="toast-container"]',
824
865
  'As your new address is outside of our delivery area it has not been updated.'
825
866
  )
826
867
  cy.url().should('eq', 'http://localhost:3000/account')
827
868
  })
828
- it('Should show modal when postcode is outside delivery area and user has digi-print subscription', () => {
869
+
870
+ it('Should show modal when selected country is UK but postcode is outside delivery area and user has digi-print subscription', () => {
829
871
  cy.GetTnlAcsSession('digiprint')
830
872
  cy.mockConsentAndVisit('/account')
831
873
 
@@ -850,14 +892,52 @@ describe('Personal detail edit pages', () => {
850
892
  ).should('exist')
851
893
  cy.contains('[data-testid="primary-button"]', 'Return to My Account')
852
894
  .should('exist')
853
- .click({ multiple: true })
895
+ .click()
854
896
  cy.contains(
855
897
  '[data-testid="toast-container"]',
856
898
  'As your new address is outside of our delivery area it has not been updated.'
857
899
  )
858
900
  cy.url().should('eq', 'http://localhost:3000/account')
859
901
  })
860
- it('Should not show modal when postcode is outside delivery area and user has print with vouchers subscription', () => {
902
+
903
+ it('Should show modal when selected country is not UK, Isle of Man, Guernsey or Jersey and user has digi-print with vouchers subscription', () => {
904
+ cy.GetTnlAcsSession('digiprintVouchers')
905
+ cy.mockConsentAndVisit('/account/edit/address')
906
+
907
+ cy.get('input[name="line1"]').clear().type('620 Atlantic Ave')
908
+ cy.get('input[name="line2"]').clear().type('Brooklyn')
909
+ cy.get('input[name="city"]').clear().type('New York')
910
+ cy.get('input[name="postcode"]').clear().type('11217')
911
+
912
+ cy.get('[data-testid="select-country"]').click()
913
+ cy.get('[data-testid="United Kingdom"]').should('be.visible')
914
+
915
+ cy.get('[data-testid="United States of America"]').click()
916
+
917
+ cy.contains('Save').click()
918
+
919
+ cy.get('[data-testid="modal"]')
920
+ .should('exist')
921
+ .should('have.length.of.at.most', 1)
922
+ cy.contains(
923
+ '[data-testid="introduction-title"]',
924
+ 'Address Outside Delivery Area'
925
+ ).should('exist')
926
+ cy.contains(
927
+ '[data-testid="description-block"]',
928
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
929
+ ).should('exist')
930
+ cy.contains('[data-testid="primary-button"]', 'Return to My Account')
931
+ .should('exist')
932
+ .click()
933
+ cy.contains(
934
+ '[data-testid="toast-container"]',
935
+ 'As your new address is outside of our delivery area it has not been updated.'
936
+ )
937
+ cy.url().should('eq', 'http://localhost:3000/account')
938
+ })
939
+
940
+ it('Should not show modal when selected country is UK and user has print with vouchers subscription', () => {
861
941
  cy.GetTnlAcsSession('printVouchers')
862
942
  cy.mockConsentAndVisit('/account')
863
943
 
@@ -890,7 +970,8 @@ describe('Personal detail edit pages', () => {
890
970
  )
891
971
  cy.url().should('eq', 'http://localhost:3000/account')
892
972
  })
893
- it('Should not show modal when postcode is outside delivery area and user has digi-print with vouchers subscription', () => {
973
+
974
+ it('Should not show modal when selected country is UK and user has digi-print with vouchers subscription', () => {
894
975
  cy.GetTnlAcsSession('digiprintVouchers')
895
976
  cy.mockConsentAndVisit('/account')
896
977
 
@@ -922,7 +1003,8 @@ describe('Personal detail edit pages', () => {
922
1003
  )
923
1004
  cy.url().should('eq', 'http://localhost:3000/account')
924
1005
  })
925
- it('Should not show modal when postcode is outside delivery area and user has digital subscription', () => {
1006
+
1007
+ it('Should not show modal when selected country is UK, postcode is outside delivery area and user has digital subscription', () => {
926
1008
  cy.GetTnlAcsSession('tnl')
927
1009
  cy.mockConsentAndVisit('/account')
928
1010
 
@@ -954,5 +1036,42 @@ describe('Personal detail edit pages', () => {
954
1036
  )
955
1037
  cy.url().should('eq', 'http://localhost:3000/account')
956
1038
  })
1039
+
1040
+ it('Should not show modal when selected country is not UK, Isle of Man, Guernsey or Jersey and user has digital subscription', () => {
1041
+ cy.mockConsentAndVisit('/account')
1042
+
1043
+ cy.get('a[href="/account/edit/address"]').click()
1044
+
1045
+ cy.get('input[name="line1"]').clear().type('620 Atlantic Ave')
1046
+ cy.get('input[name="line2"]').clear().type('Brooklyn')
1047
+ cy.get('input[name="city"]').clear().type('New York')
1048
+ cy.get('input[name="postcode"]').clear().type('11217')
1049
+
1050
+ cy.get('[data-testid="select-country"]').click()
1051
+ cy.get('[data-testid="United Kingdom"]').should('be.visible')
1052
+
1053
+ cy.get('[data-testid="United States of America"]').click()
1054
+
1055
+ cy.contains('Save').click()
1056
+
1057
+ cy.get('[data-testid="modal"]').should('not.exist')
1058
+ cy.contains(
1059
+ '[data-testid="introduction-title"]',
1060
+ 'Address Outside Delivery Area'
1061
+ ).should('not.exist')
1062
+ cy.contains(
1063
+ '[data-testid="description-block"]',
1064
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
1065
+ ).should('not.exist')
1066
+ cy.contains(
1067
+ '[data-testid="primary-button"]',
1068
+ 'Return to My Account'
1069
+ ).should('not.exist')
1070
+ cy.contains(
1071
+ '[data-testid="toast-container"]',
1072
+ 'Your address was successfully updated'
1073
+ )
1074
+ cy.url().should('eq', 'http://localhost:3000/account')
1075
+ })
957
1076
  })
958
1077
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "4.20.5-alpha.0",
3
+ "version": "4.20.5",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -47,7 +47,7 @@
47
47
  "@newskit-render/checkout": "^3.9.1",
48
48
  "@newskit-render/feature-flags": "^1.7.0",
49
49
  "@newskit-render/feed": "^1.8.4",
50
- "@newskit-render/my-account": "^7.20.2",
50
+ "@newskit-render/my-account": "^7.20.3",
51
51
  "@newskit-render/shared-components": "^4.10.1",
52
52
  "@newskit-render/standalone-components": "^3.19.1",
53
53
  "@newskit-render/validation": "^1.13.0",