@newskit-render/core 0.0.0-d55b7d88 → 0.0.0-d75fd5849

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +1392 -0
  2. package/Dockerfile.withNewRelic +1 -2
  3. package/__tests__/pages/__snapshots__/home.test.tsx.snap +1 -4
  4. package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1 -4
  5. package/components/header/banner-messages.ts +4 -0
  6. package/cypress/e2e/account/holiday-stops.cy.js +4 -4
  7. package/cypress/e2e/account/newsletters-page.cy.js +29 -9
  8. package/cypress/e2e/account/personal-details.cy.js +57 -39
  9. package/cypress/e2e/account/subscription-and-billing.cy.js +12 -42
  10. package/cypress/support/commands.js +3 -3
  11. package/cypress/support/users.js +13 -9
  12. package/helpers/getProviderPropsUtil.ts +20 -0
  13. package/next.config.js +55 -57
  14. package/package.json +12 -13
  15. package/pages/account/add/[field].tsx +11 -2
  16. package/pages/account/bonus-accounts/index.tsx +24 -0
  17. package/pages/account/cancel/index.tsx +14 -0
  18. package/pages/account/cancellation/index.tsx +5 -4
  19. package/pages/account/delete/confirm/index.tsx +3 -5
  20. package/pages/account/delete/error/index.tsx +3 -5
  21. package/pages/account/delete/index.tsx +3 -5
  22. package/pages/account/delete/success/index.tsx +3 -5
  23. package/pages/account/dream-team/index.tsx +5 -4
  24. package/pages/account/edit/[field].tsx +19 -6
  25. package/pages/account/holiday-stop/index.tsx +5 -4
  26. package/pages/account/holiday-stop/previous-holiday-stops.tsx +3 -2
  27. package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +3 -2
  28. package/pages/account/index.tsx +5 -6
  29. package/pages/account/newsletters/index.tsx +5 -4
  30. package/pages/account/newsletters-and-alerts/index.tsx +5 -7
  31. package/pages/account/payment/[paymentMethod].tsx +4 -4
  32. package/pages/account/payment/index.tsx +5 -4
  33. package/pages/account/payment-methods/index.tsx +5 -4
  34. package/pages/account/subscription-and-billing/index.tsx +15 -7
  35. package/pages/account/user-hub/index.tsx +20 -0
  36. package/pages/api/account/track-event/index.ts +16 -0
  37. package/public/assets/cancellation/another-source.png +0 -0
  38. package/public/assets/cancellation/cancellation-hero.png +0 -0
  39. package/public/assets/cancellation/content.png +0 -0
  40. package/public/assets/cancellation/delivery-problems.png +0 -0
  41. package/public/assets/cancellation/issues.png +0 -0
  42. package/public/assets/cancellation/money.png +0 -0
  43. package/public/assets/cancellation/placeholder.png +0 -0
  44. package/public/assets/cancellation/thank-you.png +0 -0
  45. package/public/assets/cancellation/time.png +0 -0
  46. package/public/assets/sun-placeholder.png +0 -0
  47. package/temp/_document.tsx +1 -0
  48. package/pages/account/family/index.tsx +0 -19
@@ -4,7 +4,6 @@ WORKDIR /app
4
4
 
5
5
  ENV NEXT_TELEMETRY_DISABLED 1
6
6
 
7
- RUN npm install @newrelic/next
8
7
  COPY .next/standalone ./standalone
9
8
  COPY public ./standalone/public
10
9
  COPY .next/static ./standalone/.next/static
@@ -12,4 +11,4 @@ COPY .next/static ./standalone/.next/static
12
11
  EXPOSE 3000
13
12
  ENV PORT 3000
14
13
 
15
- CMD ["node", "-r", "@newrelic/next", "./standalone/server.js"]
14
+ CMD ["node", "./standalone/server.js"]
@@ -6,7 +6,7 @@ exports[`getServerSideProps Homepage 1`] = `
6
6
  class="css-1d2q07x"
7
7
  >
8
8
  <div
9
- class="css-hpal4s"
9
+ class="css-w8ogm"
10
10
  data-testid="NavigationPrimary"
11
11
  >
12
12
  <div
@@ -102,7 +102,6 @@ exports[`getServerSideProps Homepage 1`] = `
102
102
  aria-label="Section One Link"
103
103
  class="css-1ulbpfm"
104
104
  href="/section-one"
105
- type="standalone"
106
105
  >
107
106
  <span
108
107
  class="css-1xnclyu"
@@ -126,7 +125,6 @@ exports[`getServerSideProps Homepage 1`] = `
126
125
  aria-label="Section Two Link"
127
126
  class="css-1ulbpfm"
128
127
  href="/section-two"
129
- type="standalone"
130
128
  >
131
129
  <span
132
130
  class="css-1xnclyu"
@@ -150,7 +148,6 @@ exports[`getServerSideProps Homepage 1`] = `
150
148
  aria-label="Section Three Link"
151
149
  class="css-1ulbpfm"
152
150
  href="/section-three"
153
- type="standalone"
154
151
  >
155
152
  <span
156
153
  class="css-1xnclyu"
@@ -6,7 +6,7 @@ exports[`Article should render tile and sub title 1`] = `
6
6
  class="css-1d2q07x"
7
7
  >
8
8
  <div
9
- class="css-hpal4s"
9
+ class="css-w8ogm"
10
10
  data-testid="NavigationPrimary"
11
11
  >
12
12
  <div
@@ -102,7 +102,6 @@ exports[`Article should render tile and sub title 1`] = `
102
102
  aria-label="Section One Link"
103
103
  class="css-1ulbpfm"
104
104
  href="/section-one"
105
- type="standalone"
106
105
  >
107
106
  <span
108
107
  class="css-1xnclyu"
@@ -126,7 +125,6 @@ exports[`Article should render tile and sub title 1`] = `
126
125
  aria-label="Section Two Link"
127
126
  class="css-1ulbpfm"
128
127
  href="/section-two"
129
- type="standalone"
130
128
  >
131
129
  <span
132
130
  class="css-1xnclyu"
@@ -150,7 +148,6 @@ exports[`Article should render tile and sub title 1`] = `
150
148
  aria-label="Section Three Link"
151
149
  class="css-1ulbpfm"
152
150
  href="/section-three"
153
- type="standalone"
154
151
  >
155
152
  <span
156
153
  class="css-1xnclyu"
@@ -32,6 +32,10 @@ export const pastDueBanner = {
32
32
  text: 'We have successfully cancelled your subscription and will be processing your refund shortly. If you have any question please call ##PHONE_NUMBER##.',
33
33
  dismissDays: 7,
34
34
  },
35
+ paymentFailure: {
36
+ title: 'We haven’t been able to take payment',
37
+ text: 'Your latest payment has failed. Please update your payment details as soon as possible to keep your membership.',
38
+ },
35
39
  treshold: {
36
40
  firstNotice: 26,
37
41
  secondNotice: 30,
@@ -1,6 +1,6 @@
1
1
  import { getTestDates } from '../../fixtures/testDates'
2
2
 
3
- describe('Book a Holiday Stop', () => {
3
+ describe.skip('Book a Holiday Stop', () => {
4
4
  beforeEach(() => {
5
5
  cy.GetTnlAcsSession('tnl')
6
6
  cy.mockConsentAndVisit('/account/holiday-stop')
@@ -13,7 +13,7 @@ describe('Book a Holiday Stop', () => {
13
13
  })
14
14
  })
15
15
 
16
- describe('Add a Holiday Stop', () => {
16
+ describe.skip('Add a Holiday Stop', () => {
17
17
  beforeEach(() => {
18
18
  cy.GetTnlAcsSession('tnl')
19
19
  cy.mockConsentAndVisit('/account/add/holiday-stop')
@@ -52,7 +52,7 @@ describe('Add a Holiday Stop', () => {
52
52
  })
53
53
  })
54
54
 
55
- describe('Upcoming Holiday Stops - edit button', () => {
55
+ describe.skip('Upcoming Holiday Stops - edit button', () => {
56
56
  beforeEach(() => {
57
57
  cy.GetTnlAcsSession('tnl')
58
58
  cy.mockConsentAndVisit('/account/holiday-stop')
@@ -86,7 +86,7 @@ describe('Upcoming Holiday Stops - edit button', () => {
86
86
  })
87
87
  })
88
88
 
89
- describe('Cancel Holiday Stop', () => {
89
+ describe.skip('Cancel Holiday Stop', () => {
90
90
  beforeEach(() => {
91
91
  cy.GetTnlAcsSession('tnl')
92
92
  cy.mockConsentAndVisit('/account/holiday-stop')
@@ -1,33 +1,52 @@
1
1
  describe('Newsletters page', () => {
2
2
  beforeEach(() => {
3
3
  cy.GetTnlAcsSession()
4
+ cy.mockConsent()
5
+ })
6
+
7
+ it('Should display all the newsletters on the newsletters page when user has a subscription', () => {
4
8
  cy.mockConsentAndVisit('/account/newsletters')
9
+ cy.contains('Newsletters')
10
+ cy.contains(
11
+ 'Exclusive content and a curated selection of our top stories straight to your inbox.'
12
+ )
13
+ cy.get('[data-testid="newsletters-grid"] > div > div').should(
14
+ 'have.length.greaterThan',
15
+ 1
16
+ )
5
17
  })
6
18
 
7
- it('Should display the newsletters page', () => {
19
+ it('Should only display selected newsletters on the newsletters page when user is registered', () => {
20
+ cy.GetTnlAcsSession('tnlNoSubscription')
21
+ cy.mockConsentAndVisit('/account/newsletters')
8
22
  cy.contains('Newsletters')
9
23
  cy.contains(
10
24
  'Exclusive content and a curated selection of our top stories straight to your inbox.'
11
25
  )
12
- cy.get('[data-testid="newsletters-grid"] > div').should('have.length', 20)
26
+ cy.get('[data-testid="newsletters-grid"] > div > div').should(
27
+ 'have.length.greaterThan',
28
+ 1
29
+ )
13
30
  })
14
31
 
15
32
  it('Should display all required newsletter text in the first grid card', () => {
16
- cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
33
+ cy.mockConsentAndVisit('/account/newsletters')
34
+ cy.get('[data-testid="newsletters-grid-featured"]').then(($parentDiv) => {
17
35
  const firstNewsletter = $parentDiv.find('div:first-child')
18
36
 
19
- cy.wrap(firstNewsletter).contains('Business').should('be.visible')
37
+ cy.wrap(firstNewsletter).contains('Daily Briefing').should('be.visible')
20
38
  cy.wrap(firstNewsletter).contains('Daily').should('be.visible')
21
39
  cy.wrap(firstNewsletter)
22
40
  .contains(
23
- "The business editor's exclusive analysis of all the latest financial and economic news."
41
+ 'Our flagship newsletter with our top stories and exclusive analysis every morning.'
24
42
  )
25
43
  .should('be.visible')
26
44
  })
27
45
  })
28
46
 
29
47
  it('Should successfully subscribe to a newsletter', () => {
30
- cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
48
+ cy.mockConsentAndVisit('/account/newsletters')
49
+ cy.get('[data-testid="newsletters-grid-featured"]').then(($parentDiv) => {
31
50
  cy.intercept('POST', '/api/account/mutate', { statusCode: 200, ok: true })
32
51
 
33
52
  const firstNewsletter = $parentDiv.find('div:first-child')
@@ -40,13 +59,14 @@ describe('Newsletters page', () => {
40
59
 
41
60
  cy.contains(
42
61
  '[data-testid="toast-container"]',
43
- 'Thank you, you are now signed up to the Business newsletter'
62
+ 'Thank you, you are now signed up to the Daily Briefing newsletter'
44
63
  )
45
64
  })
46
65
  })
47
66
 
48
67
  it('Should show the error toast on server error', () => {
49
- cy.get('[data-testid="newsletters-grid"]').then(($parentDiv) => {
68
+ cy.mockConsentAndVisit('/account/newsletters')
69
+ cy.get('[data-testid="newsletters-grid-featured"]').then(($parentDiv) => {
50
70
  cy.intercept('POST', '/api/account/mutate', {
51
71
  statusCode: 500,
52
72
  ok: false,
@@ -62,7 +82,7 @@ describe('Newsletters page', () => {
62
82
 
63
83
  cy.contains(
64
84
  '[data-testid="toast-container"]',
65
- 'Sorry we were unable to sign you up to the Business newsletter, please try again'
85
+ 'Sorry we were unable to sign you up to the Daily Briefing newsletter, please try again'
66
86
  )
67
87
  })
68
88
  })
@@ -317,44 +317,7 @@ describe('Personal detail edit pages', () => {
317
317
  expect(loc.pathname).to.eq('/account')
318
318
  })
319
319
  })
320
- it('Should change user email', () => {
321
- const currentEmail = 'cmp-digi-card-20-09-22@yopmail.com'
322
- const notRegistredEmail = 'not-registered-email@yopmail.com'
323
-
324
- cy.get('a[href="/account/edit/email"]').should('be.visible').click()
325
-
326
- cy.get('[name="email"]').clear()
327
- cy.get('[name="email"]').type(notRegistredEmail)
328
- cy.get('[data-testid="primary-button"]').click()
329
-
330
- cy.contains('[data-testid="toast-container"]', 'Updating your email...')
331
-
332
- // Redirects to Personal details page
333
- cy.location().should((loc) => {
334
- expect(loc.pathname).to.eq('/account')
335
- })
336
- cy.contains(notRegistredEmail).should('have.length', 1)
337
- cy.contains(
338
- '[data-testid="toast-container"]',
339
- 'Your email address was successfully updated'
340
- )
341
-
342
- // Back to edit email page
343
320
 
344
- cy.get('a[href="/account/edit/email"]')
345
- .should('be.visible')
346
- .click({ force: true })
347
-
348
- // Check the message for verification link
349
- cy.contains(
350
- `Email sent to ${notRegistredEmail} with a verification link. If you haven't received it yet, check again later or contact customer services on xxxx-xxx-xxxx`
351
- )
352
-
353
- // Change email back to the previous email
354
- cy.get('[name="email"]').clear()
355
- cy.get('[name="email"]').type(currentEmail)
356
- cy.get('[data-testid="primary-button"]').click()
357
- })
358
321
  it('Should NOT change user email if input value is already registered mail', () => {
359
322
  const alreadyRegistredEmail = 'cmp-digi-direct-20-09-22@yopmail.com'
360
323
 
@@ -370,6 +333,7 @@ describe('Personal detail edit pages', () => {
370
333
  'This email address is already in use. Try a different one or contact customer support at 1234-1234'
371
334
  )
372
335
  })
336
+
373
337
  it('Should show input validation error messages when user tries to add invalid email', () => {
374
338
  cy.get('a[href="/account/edit/email"]').should('be.visible').click()
375
339
 
@@ -391,6 +355,7 @@ describe('Personal detail edit pages', () => {
391
355
  'Updating your email...'
392
356
  ).should('not.exist')
393
357
  })
358
+
394
359
  it('Should show error toast when updating email if internal server error occures', () => {
395
360
  cy.intercept('POST', '/api/account/mutate', { statusCode: 500 })
396
361
 
@@ -406,6 +371,45 @@ describe('Personal detail edit pages', () => {
406
371
  "Sorry, we're unable to save your email right now. Please try again or come back later."
407
372
  )
408
373
  })
374
+
375
+ it('Should change user email', () => {
376
+ const currentEmail = 'cmp-digi-card-20-09-22@yopmail.com'
377
+ const notRegistredEmail = 'not-registered-email@yopmail.com'
378
+
379
+ cy.get('a[href="/account/edit/email"]').should('be.visible').click()
380
+
381
+ cy.get('[name="email"]').clear()
382
+ cy.get('[name="email"]').type(notRegistredEmail)
383
+ cy.get('[data-testid="primary-button"]').click()
384
+
385
+ cy.contains('[data-testid="toast-container"]', 'Updating your email...')
386
+
387
+ // Redirects to Personal details page
388
+ cy.location().should((loc) => {
389
+ expect(loc.pathname).to.eq('/account')
390
+ })
391
+ cy.contains(notRegistredEmail).should('have.length', 1)
392
+ cy.contains(
393
+ '[data-testid="toast-container"]',
394
+ 'Your email address was successfully updated'
395
+ )
396
+
397
+ // Back to edit email page
398
+
399
+ cy.get('a[href="/account/edit/email"]')
400
+ .should('be.visible')
401
+ .click({ force: true })
402
+
403
+ // Check the message for verification link
404
+ cy.contains(
405
+ `Email sent to ${notRegistredEmail} with a verification link. If you haven't received it yet, check again later or contact customer services on xxxx-xxx-xxxx`
406
+ )
407
+
408
+ // Change email back to the previous email
409
+ cy.get('[name="email"]').clear()
410
+ cy.get('[name="email"]').type(currentEmail)
411
+ cy.get('[data-testid="primary-button"]').click()
412
+ })
409
413
  })
410
414
 
411
415
  describe('Edit password', () => {
@@ -864,7 +868,9 @@ describe('Personal detail edit pages', () => {
864
868
  cy.get('[data-testid="select-country"]').click()
865
869
  cy.get('[data-testid="United Kingdom"]').should('be.visible')
866
870
 
867
- cy.get('[data-testid="United States of America"]').click()
871
+ cy.get('[data-testid="select-panel"]').within(() => {
872
+ cy.get('[data-testid="United States of America"]').click()
873
+ })
868
874
 
869
875
  cy.contains('Save').click()
870
876
 
@@ -977,7 +983,9 @@ describe('Personal detail edit pages', () => {
977
983
  cy.get('[data-testid="select-country"]').click()
978
984
  cy.get('[data-testid="United Kingdom"]').should('be.visible')
979
985
 
980
- cy.get('[data-testid="United States of America"]').click()
986
+ cy.get('[data-testid="select-panel"]').within(() => {
987
+ cy.get('[data-testid="United States of America"]').click()
988
+ })
981
989
 
982
990
  cy.contains('Save').click()
983
991
 
@@ -1018,6 +1026,12 @@ describe('Personal detail edit pages', () => {
1018
1026
  cy.get('input[name="county"]').type('North Yorkshire')
1019
1027
  cy.get('input[name="postcode"]').clear()
1020
1028
  cy.get('input[name="postcode"]').type('YO1 6DJ')
1029
+ cy.get('[data-testid="select-country"]').click()
1030
+ cy.get('[data-testid="United Kingdom"]').should('be.visible')
1031
+
1032
+ cy.get('[data-testid="select-panel"]').within(() => {
1033
+ cy.get('[data-testid="United Kingdom"]').click()
1034
+ })
1021
1035
 
1022
1036
  cy.contains('Save').click()
1023
1037
 
@@ -1055,6 +1069,10 @@ describe('Personal detail edit pages', () => {
1055
1069
  cy.get('input[name="city"]').type('London')
1056
1070
  cy.get('input[name="postcode"]').clear()
1057
1071
  cy.get('input[name="postcode"]').type('SE1')
1072
+ cy.get('[data-testid="select-country"]').click()
1073
+ cy.get('[data-testid="select-panel"]').within(() => {
1074
+ cy.get('[data-testid="United Kingdom"]').click()
1075
+ })
1058
1076
 
1059
1077
  cy.contains('Save').click()
1060
1078
 
@@ -134,18 +134,18 @@ describe('Subscription and billing details for Digital user', () => {
134
134
  cy.contains('[data-testid="ContentListIntroduction"]', 'Billing details')
135
135
  cy.contains('Payment method')
136
136
  cy.get('[data-testid="visa-icon"]').should('exist')
137
- cy.contains('************1111')
138
- cy.contains('expiry date 03/30')
137
+ cy.contains('************4242')
138
+ cy.contains('expiry date 02/27')
139
139
  })
140
140
 
141
- it('Should display Invoice history section', () => {
142
- cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
143
- cy.contains('Digital pack')
144
- cy.contains('20 Sept 2022')
145
- cy.contains('Paid')
146
- cy.get('a[data-testid="download-button"]')
147
- .should('have.attr', 'href', '#')
148
- .contains('View')
141
+ // Section no longer displayed when Invoice history is empty due to graphql change
142
+ // Invoices are no longer fetched if older than 1 year
143
+ // This test would periodically fail as it depends on changing user data
144
+ it('Should not display empty Invoice history section', () => {
145
+ cy.get('[data-testid="ContentListIntroduction"]').should(
146
+ 'not.contain',
147
+ 'Invoice history'
148
+ )
149
149
  })
150
150
 
151
151
  it('Should NOT display Your deliveries section', () => {
@@ -213,7 +213,7 @@ describe('Subscription and billing details for Print user', () => {
213
213
  it('Should display Your deliveries section', () => {
214
214
  cy.contains('[data-testid="ContentListIntroduction"]', 'Your deliveries')
215
215
  cy.contains('Address')
216
- cy.contains('Buckingham Palace, London, SW1A 1AA')
216
+ cy.contains('Buckingham Palace, London, SW1A')
217
217
  cy.contains('Delivery instructions')
218
218
  cy.contains('On my doorstep')
219
219
  cy.contains('Holiday Stops')
@@ -226,16 +226,6 @@ describe('Subscription and billing details for Print user', () => {
226
226
  )
227
227
  })
228
228
 
229
- it('Should display Invoice history section', () => {
230
- cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
231
- cy.contains('Print pack')
232
- cy.contains('24 Apr 2023')
233
- cy.contains('Paid')
234
- cy.get('a[data-testid="download-button"]')
235
- .should('have.attr', 'href', '#')
236
- .contains('View')
237
- })
238
-
239
229
  it('Should display Your deliveries section for users with vouchers', () => {
240
230
  cy.GetTnlAcsSession('printVouchers')
241
231
  cy.mockConsentAndVisit('/account/subscription-and-billing')
@@ -243,8 +233,6 @@ describe('Subscription and billing details for Print user', () => {
243
233
  cy.contains('[data-testid="ContentListIntroduction"]', 'Your deliveries')
244
234
  cy.contains('Address')
245
235
  cy.contains('2 Tuke House, Cromwell Road, York, YO1 6DJ, North Yorkshire')
246
- cy.contains('Delivery instructions')
247
- cy.contains('On my doorstep')
248
236
  cy.contains('Holiday Stops')
249
237
  cy.contains(
250
238
  'You can pause your print delivery at any time by adding a Holiday Stop to your account. Holiday Stops need to be booked before 16:00 GMT the day before you want to pause delivery.'
@@ -254,7 +242,7 @@ describe('Subscription and billing details for Print user', () => {
254
242
  'If your voucher booklet hasn’t arrived within three days of your booklet start date, or you have any issues regarding your vouchers, please contact us.'
255
243
  )
256
244
  cy.contains('Voucher booklet start date')
257
- cy.contains('16/06/24')
245
+ cy.contains('20/09/2022')
258
246
  cy.contains(
259
247
  'Your contact address will be used for any of your deliveries. This can be managed via Personal details'
260
248
  )
@@ -277,16 +265,6 @@ describe('Subscription and billing details for Digi-Print user', () => {
277
265
  cy.contains('Digi-Print')
278
266
  //...rest is same as Print user
279
267
  })
280
-
281
- it('Should display Invoice history section', () => {
282
- cy.contains('[data-testid="ContentListIntroduction"]', 'Invoice history')
283
- cy.contains('Digi-Print pack')
284
- cy.contains('12 Nov 2023')
285
- cy.contains('Paid')
286
- cy.get('a[data-testid="download-button"]')
287
- .should('have.attr', 'href', '#')
288
- .contains('View')
289
- })
290
268
  })
291
269
 
292
270
  describe('Subscription and billing details for Paypal user', () => {
@@ -302,14 +280,6 @@ describe('Subscription and billing details for Paypal user', () => {
302
280
  cy.get('[data-testid="paypal-icon"]').should('exist')
303
281
  cy.contains('cmp.paypal.user.verified.test@news.co.uk')
304
282
  })
305
-
306
- it('Should show inline banner for Paypal subscription', () => {
307
- cy.get('a[href="/account/payment"]').should('be.visible').click()
308
- cy.contains(
309
- '[data-testid="Zuora-inline"]',
310
- 'To update your Paypal credentials, please speak to one of our advisors on xxxx-xxx-xxxx or add a new payment method via credit/debit card using the form below.'
311
- )
312
- })
313
283
  })
314
284
 
315
285
  describe('Subscription and billing edit pages', () => {
@@ -1,4 +1,4 @@
1
- //Note: Check periodically if these consent cookie values exprire
1
+ //Note: Check periodically if these consent cookie values expire
2
2
  import _ from 'lodash'
3
3
  import {
4
4
  consentUUIDValue,
@@ -60,13 +60,13 @@ Cypress.Commands.add('GetTnlAcsSession', (user = 'tnl') => {
60
60
 
61
61
  cy.request({
62
62
  method: 'POST',
63
- url: 'https://login.staging-thetimes.co.uk/services/session',
63
+ url: 'https://login.staging-thetimes.com/services/session',
64
64
  headers: {
65
65
  'Content-Type': 'application/vnd.newsuk.acs.createsession-v1+json',
66
66
  },
67
67
  body: {
68
68
  rememberMe: false,
69
- gotoUrl: 'https://login.staging-thetimes.co.uk/',
69
+ gotoUrl: 'https://login.staging-thetimes.com/',
70
70
  sso: false,
71
71
  authCredentials: {
72
72
  username,
@@ -22,37 +22,41 @@ export const userMap = {
22
22
  },
23
23
  tnl: {
24
24
  username: 'cmp1aug2022printstag@yopmail.com', //Print user
25
- password: 'Password123',
25
+ password: 'Password123Testing123$',
26
26
  },
27
27
  digitalCard: {
28
28
  //dtc=false
29
29
  username: 'cmp-digi-card-20-09-22@yopmail.com',
30
- password: 'Password123',
30
+ password: 'Password123Testing123$',
31
31
  },
32
32
  digitalDirectDebit: {
33
33
  //dtc=false
34
34
  username: 'cmp-digi-direct-20-09-22@yopmail.com',
35
- password: 'Password123',
35
+ password: 'Password123Testing123$',
36
36
  },
37
37
  print: {
38
38
  //dtc=true
39
39
  username: 'cmp-dtc-card-20-09-22@yopmail.com',
40
- password: 'Password123',
40
+ password: 'Password123Testing123$',
41
41
  },
42
42
  printVouchers: {
43
43
  //dtc=false
44
44
  username: 'cmp-test-direct-20-09-22@yopmail.com',
45
- password: 'Password123',
45
+ password: 'Password123Testing123$',
46
46
  },
47
47
  digiprint: {
48
48
  //dtc=true
49
49
  username: 'digi-print.dtc.test@yopmail.com',
50
- password: 'Password123',
50
+ password: 'Password123Testing123$',
51
51
  },
52
52
  digiprintVouchers: {
53
53
  //dtc=false
54
54
  username: 'digi-print-card-15-11-22@yopmail.com',
55
- password: 'Password123',
55
+ password: 'Password123Testing123$',
56
56
  },
57
- }
58
-
57
+ tnlNoSubscription: {
58
+ //registered user with no subscription, tests the number of newsletters displayed
59
+ username: 'tm-test+staging-registered-user@news.co.uk',
60
+ password: 'Growth123',
61
+ },
62
+ }
@@ -0,0 +1,20 @@
1
+ import {
2
+ getProviderProps,
3
+ getProviderPropsTimes,
4
+ } from '@newskit-render/my-account'
5
+ import { publisher } from '../config'
6
+
7
+ export const getProviderPropsUtil = (context, options?) => {
8
+ if (process.env.NODE_ENV === 'development' && publisher === 'TIMES') {
9
+ return getProviderPropsTimes({
10
+ context,
11
+ options: {
12
+ ...options,
13
+ },
14
+ })
15
+ }
16
+
17
+ return getProviderProps(context, {
18
+ ...options,
19
+ })
20
+ }