@newskit-render/core 4.19.3 → 4.19.4-alpha.1

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.19.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@4.19.3-alpha.0...@newskit-render/core@4.19.3) (2023-11-08)
7
+
8
+ **Note:** Version bump only for package @newskit-render/core
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.19.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@4.19.2-alpha.0...@newskit-render/core@4.19.2) (2023-10-30)
7
15
 
8
16
  **Note:** Version bump only for package @newskit-render/core
@@ -1,6 +1,3 @@
1
- import * as printSubscriptionPageProps from '../../fixtures/print-subscriptions/print-subscription-response.json'
2
- import * as voucherSubscriptionPageProps from '../../fixtures/print-subscriptions/voucher-subscription-response.json'
3
-
4
1
  describe('Account without user', () => {
5
2
  beforeEach(() => {
6
3
  cy.mockConsentAndVisit('/account')
@@ -101,6 +98,7 @@ describe('My account personal details', () => {
101
98
  'Your last name can’t contain special characters. Please try again.'
102
99
  )
103
100
  })
101
+
104
102
  // TODO: Uncomment and change the dob when we have a test account with date of birth. Current one fails because it's set to null
105
103
  // it('Should Display date of birth', () => {
106
104
  // cy.contains('21/03/1988')
@@ -288,55 +286,6 @@ describe('My account personal details', () => {
288
286
  "Sorry, we're unable to save your address right now. Please try again or come back later."
289
287
  )
290
288
  })
291
-
292
- it('Should show modal when postcode is outside delivery area', () => {
293
- cy.visitAndOverrideNextData(
294
- '/account/edit/address',
295
- 'props.pageProps.data.subscriptions',
296
- printSubscriptionPageProps.props.pageProps.user.subscriptions
297
- )
298
- cy.get('input[name="line1"]').clear().type('News UK')
299
- cy.get('input[name="line2"]').clear().type('1 London Bridge Street')
300
- cy.get('input[name="line3"]').clear().type('Buckie')
301
- cy.get('input[name="city"]').clear().type('London')
302
- cy.get('input[name="county"]').clear().type('Kent')
303
- cy.get('input[name="postcode"]').clear().type('SE1')
304
- cy.get('[data-testid="primary-button"]').click()
305
- cy.get('[data-testid="description-block"]').should('exist')
306
- cy.get('[data-testid="modal-link-0"]').should('exist')
307
- cy.get('[aria-label="Return to My Account"]').click({ multiple: true })
308
- cy.contains(
309
- '[data-testid="toast-container"]',
310
- 'As your new address is outside of our delivery area it has not been updated.'
311
- )
312
- cy.url().should('eq', 'http://localhost:3000/account')
313
- })
314
-
315
- it('Should not show modal when postcode is outside delivery area and user has vouchers', () => {
316
- cy.visitAndOverrideNextData(
317
- '/account/edit/address',
318
- 'props.pageProps.data.subscriptions',
319
- voucherSubscriptionPageProps.props.pageProps.user.subscriptions
320
- )
321
- cy.get('input[name="line1"]').clear().type('2 Tuke House')
322
- cy.get('input[name="line2"]').clear().type('Cromwell Road')
323
- cy.get('input[name="line3"]').clear().type('3rd optional line')
324
- cy.get('input[name="city"]').clear().type('York')
325
- cy.get('input[name="county"]').clear().type('North Yorkshire')
326
- cy.get('input[name="postcode"]').clear().type('YO1 6DJ')
327
-
328
- cy.get('[data-testid="primary-button"]').click()
329
-
330
- cy.get('[data-testid="description-block"]').should('not.exist')
331
- cy.get('[data-testid="modal-link-0"]').should('not.exist')
332
- cy.get('Address Outside Delivery Area').should('not.exist')
333
- cy.get('Return to My Account').should('not.exist')
334
- cy.contains(
335
- '[data-testid="toast-container"]',
336
- 'Your address was successfully updated'
337
- )
338
- cy.url().should('eq', 'http://localhost:3000/account')
339
- })
340
289
  })
341
290
 
342
291
  describe('My account personal details - Display name', () => {
@@ -402,3 +351,176 @@ describe('My account personal details - Display name', () => {
402
351
  })
403
352
  })
404
353
  })
354
+
355
+ describe('My account personal details - Edit address - Outside delivery area modal', () => {
356
+ //print
357
+ it('Should show modal when postcode is outside delivery area and user has print subscription', () => {
358
+ cy.GetTnlAcsSession('print')
359
+ cy.mockConsentAndVisit('/account')
360
+
361
+ cy.get('a[href="/account/edit/address"]').click({ force: true })
362
+
363
+ cy.get('input[name="line1"]').clear().type('Buckingham Palace')
364
+ cy.get('input[name="city"]').clear().type('London')
365
+ cy.get('input[name="postcode"]').clear().type('SW1A')
366
+
367
+ cy.contains('Save').click()
368
+
369
+ cy.get('[data-testid="modal"]')
370
+ .should('exist')
371
+ .should('have.length.of.at.most', 1)
372
+ cy.contains(
373
+ '[data-testid="introduction-title"]',
374
+ 'Address Outside Delivery Area'
375
+ ).should('exist')
376
+ cy.contains(
377
+ '[data-testid="description-block"]',
378
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
379
+ ).should('exist')
380
+ cy.contains('[data-testid="primary-button"]', 'Return to My Account')
381
+ .should('exist')
382
+ .click({ multiple: true })
383
+ cy.contains(
384
+ '[data-testid="toast-container"]',
385
+ 'As your new address is outside of our delivery area it has not been updated.'
386
+ )
387
+ cy.url().should('eq', 'http://localhost:3000/account')
388
+ })
389
+
390
+ //digiprint
391
+ it('Should show modal when postcode is outside delivery area and user has digi-print subscription', () => {
392
+ cy.GetTnlAcsSession('digiprint')
393
+ cy.mockConsentAndVisit('/account')
394
+
395
+ cy.get('a[href="/account/edit/address"]').click({ force: true })
396
+
397
+ cy.get('input[name="line1"]').clear().type('1 London Bridge Street')
398
+ cy.get('input[name="city"]').clear().type('London')
399
+ cy.get('input[name="postcode"]').clear().type('SE1')
400
+
401
+ cy.contains('Save').click()
402
+
403
+ cy.get('[data-testid="modal"]')
404
+ .should('exist')
405
+ .should('have.length.of.at.most', 1)
406
+ cy.contains(
407
+ '[data-testid="introduction-title"]',
408
+ 'Address Outside Delivery Area'
409
+ ).should('exist')
410
+ cy.contains(
411
+ '[data-testid="description-block"]',
412
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
413
+ ).should('exist')
414
+ cy.contains('[data-testid="primary-button"]', 'Return to My Account')
415
+ .should('exist')
416
+ .click({ multiple: true })
417
+ cy.contains(
418
+ '[data-testid="toast-container"]',
419
+ 'As your new address is outside of our delivery area it has not been updated.'
420
+ )
421
+ cy.url().should('eq', 'http://localhost:3000/account')
422
+ })
423
+
424
+ //printVouchers
425
+ it('Should not show modal when postcode is outside delivery area and user has print with vouchers subscription', () => {
426
+ cy.GetTnlAcsSession('printVouchers')
427
+ cy.mockConsentAndVisit('/account')
428
+
429
+ cy.get('a[href="/account/edit/address"]').click({ force: true })
430
+
431
+ cy.get('input[name="line1"]').clear().type('2 Tuke House')
432
+ cy.get('input[name="line2"]').clear().type('Cromwell Road')
433
+ cy.get('input[name="city"]').clear().type('York')
434
+ cy.get('input[name="county"]').clear().type('North Yorkshire')
435
+ cy.get('input[name="postcode"]').clear().type('YO1 6DJ')
436
+
437
+ cy.contains('Save').click()
438
+
439
+ cy.get('[data-testid="modal"]').should('not.exist')
440
+ cy.contains(
441
+ '[data-testid="introduction-title"]',
442
+ 'Address Outside Delivery Area'
443
+ ).should('not.exist')
444
+ cy.contains(
445
+ '[data-testid="description-block"]',
446
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
447
+ ).should('not.exist')
448
+ cy.contains(
449
+ '[data-testid="primary-button"]',
450
+ 'Return to My Account'
451
+ ).should('not.exist')
452
+ cy.contains(
453
+ '[data-testid="toast-container"]',
454
+ 'Your address was successfully updated'
455
+ )
456
+ cy.url().should('eq', 'http://localhost:3000/account')
457
+ })
458
+
459
+ //digiprintVouchers
460
+ it('Should not show modal when postcode is outside delivery area and user has digi-print with vouchers subscription', () => {
461
+ cy.GetTnlAcsSession('digiprintVouchers')
462
+ cy.mockConsentAndVisit('/account')
463
+
464
+ cy.get('a[href="/account/edit/address"]').click({ force: true })
465
+
466
+ cy.get('input[name="line1"]').clear().type('Harpercollins Publishers')
467
+ cy.get('input[name="line2"]').clear().type('1 London Bridge Street')
468
+ cy.get('input[name="city"]').clear().type('London')
469
+ cy.get('input[name="postcode"]').clear().type('SE1')
470
+
471
+ cy.contains('Save').click()
472
+
473
+ cy.get('[data-testid="modal"]').should('not.exist')
474
+ cy.contains(
475
+ '[data-testid="introduction-title"]',
476
+ 'Address Outside Delivery Area'
477
+ ).should('not.exist')
478
+ cy.contains(
479
+ '[data-testid="description-block"]',
480
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
481
+ ).should('not.exist')
482
+ cy.contains(
483
+ '[data-testid="primary-button"]',
484
+ 'Return to My Account'
485
+ ).should('not.exist')
486
+ cy.contains(
487
+ '[data-testid="toast-container"]',
488
+ 'Your address was successfully updated'
489
+ )
490
+ cy.url().should('eq', 'http://localhost:3000/account')
491
+ })
492
+
493
+ //digital
494
+ it('Should not show modal when postcode is outside delivery area and user has digital subscription', () => {
495
+ cy.GetTnlAcsSession('tnl')
496
+ cy.mockConsentAndVisit('/account')
497
+
498
+ cy.get('a[href="/account/edit/address"]').click({ force: true })
499
+
500
+ cy.get('input[name="line1"]').clear().type('News UK')
501
+ cy.get('input[name="line2"]').clear().type('1 London Bridge Street')
502
+ cy.get('input[name="city"]').clear().type('London')
503
+ cy.get('input[name="postcode"]').clear().type('SE1')
504
+
505
+ cy.contains('Save').click()
506
+
507
+ cy.get('[data-testid="modal"]').should('not.exist')
508
+ cy.contains(
509
+ '[data-testid="introduction-title"]',
510
+ 'Address Outside Delivery Area'
511
+ ).should('not.exist')
512
+ cy.contains(
513
+ '[data-testid="description-block"]',
514
+ 'Unfortunately the address you entered is outside of our delivery area so cannot be updated online.'
515
+ ).should('not.exist')
516
+ cy.contains(
517
+ '[data-testid="primary-button"]',
518
+ 'Return to My Account'
519
+ ).should('not.exist')
520
+ cy.contains(
521
+ '[data-testid="toast-container"]',
522
+ 'Your address was successfully updated'
523
+ )
524
+ cy.url().should('eq', 'http://localhost:3000/account')
525
+ })
526
+ })
@@ -73,7 +73,7 @@ describe('MAIN API', () => {
73
73
  expect(response.body.mobile).to.eq('+447777777778')
74
74
  expect(response.body.firstName).to.eq('John')
75
75
  expect(response.body.lastName).to.eq('Smith')
76
- expect(response.body.address.city).to.eq('York')
76
+ expect(response.body.address.city).to.eq('London')
77
77
  })
78
78
  })
79
79
  })
@@ -58,6 +58,26 @@ const userMap = {
58
58
  username: 'cmp1aug2022printstag@yopmail.com',
59
59
  password: 'Password123',
60
60
  },
61
+ print: {
62
+ //dtc=true
63
+ username: 'cmp-dtc-card-20-09-22@yopmail.com',
64
+ password: 'Password123',
65
+ },
66
+ printVouchers: {
67
+ //dtc=false
68
+ username: 'cmp-test-direct-20-09-22@yopmail.com',
69
+ password: 'Password123',
70
+ },
71
+ digiprint: {
72
+ //dtc=true
73
+ username: 'digi-print.dtc.test@yopmail.com',
74
+ password: 'Password123',
75
+ },
76
+ digiprintVouchers: {
77
+ //dtc=false
78
+ username: 'digi-print-card-15-11-22@yopmail.com',
79
+ password: 'Password123',
80
+ },
61
81
  }
62
82
 
63
83
  Cypress.Commands.add('GetAcsSession', (user = 'default') => {
@@ -85,6 +105,7 @@ Cypress.Commands.add('GetAcsSession', (user = 'default') => {
85
105
 
86
106
  Cypress.Commands.add('GetTnlAcsSession', (user = 'tnl') => {
87
107
  const { username, password } = userMap[user]
108
+
88
109
  cy.request({
89
110
  method: 'POST',
90
111
  url: 'https://login.staging-thetimes.co.uk/services/session',
@@ -1,14 +1,7 @@
1
- import * as printSubscriptionPageProps from '../../fixtures/print-subscriptions/print-subscription-response.json'
2
-
3
1
  describe('Visual regression for print and digi_print subscriptions', () => {
4
2
  it('should show sections for print user subscriptions', () => {
5
- cy.GetAcsSession('withSub')
6
- cy.mockConsent()
7
- cy.visitAndOverrideNextData(
8
- '/account/subscription-and-billing',
9
- 'props.pageProps.user.subscriptions',
10
- printSubscriptionPageProps.props.pageProps.user.subscriptions
11
- )
3
+ cy.GetTnlAcsSession('print')
4
+ cy.mockConsentAndVisit('/account/subscription-and-billing')
12
5
  // eslint-disable-next-line cypress/no-unnecessary-waiting
13
6
  cy.wait(1000)
14
7
  cy.percySnapshot('Subscription and Billing page for print subscriptions')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "4.19.3",
3
+ "version": "4.19.4-alpha.1",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -44,12 +44,12 @@
44
44
  "@newrelic/winston-enricher": "4.0.1",
45
45
  "@newskit-render/api": "^1.10.0",
46
46
  "@newskit-render/auth": "^1.7.2",
47
- "@newskit-render/checkout": "^3.8.2",
47
+ "@newskit-render/checkout": "^3.8.3-alpha.0",
48
48
  "@newskit-render/feature-flags": "^1.7.0",
49
49
  "@newskit-render/feed": "^1.8.3",
50
- "@newskit-render/my-account": "^7.17.2",
51
- "@newskit-render/shared-components": "^4.9.1",
52
- "@newskit-render/standalone-components": "^3.18.2",
50
+ "@newskit-render/my-account": "^7.17.3-alpha.0",
51
+ "@newskit-render/shared-components": "^4.9.2-alpha.0",
52
+ "@newskit-render/standalone-components": "^3.18.3-alpha.0",
53
53
  "@newskit-render/validation": "^1.13.0",
54
54
  "cross-fetch": "3.1.5",
55
55
  "graphql": "16.6.0",
@@ -1,50 +0,0 @@
1
- {
2
- "props": {
3
- "pageProps": {
4
- "user": {
5
- "paymentFailure": {
6
- "__typename": "CustomerPaymentFailure",
7
- "active": false,
8
- "startDate": null
9
- },
10
- "subscriptions": [
11
- {
12
- "id": "SUB-0010708256",
13
- "startDate": "2022-08-01T13:22:33",
14
- "serviceCancellationDate": null,
15
- "isActive": true,
16
- "currency": "GBP",
17
- "price": 0,
18
- "type": "Print",
19
- "status": "Active",
20
- "billingDetails": {
21
- "__typename": "BillingDetails",
22
- "billCycleDay": null,
23
- "paymentMethod": {
24
- "__typename": "PaymentMethod",
25
- "cardType": null,
26
- "cardNumber": null,
27
- "type": null,
28
- "expirationYear": null,
29
- "expirationMonth": null
30
- }
31
- },
32
- "__typename": "Subscription"
33
- }
34
- ],
35
- "__typename": "User",
36
- "cpn": "4AAA039158001"
37
- },
38
- "env": { "LOQACCOUNT_KEY": "" }
39
- },
40
- "tenant": "DEMO",
41
- "__N_SSP": true
42
- },
43
- "page": "/account/subscription-and-billing",
44
- "query": {},
45
- "buildId": "development",
46
- "isFallback": false,
47
- "gssp": true,
48
- "appGip": true,
49
- "scriptLoader": []
50
- }
@@ -1,101 +0,0 @@
1
- {
2
- "props": {
3
- "pageProps": {
4
- "user": {
5
- "userId": null,
6
- "cpn": "4AAA039261010",
7
- "firstName": "Test",
8
- "lastName": "test",
9
- "email": "cmp-test-direct-20-09-22@yopmail.com",
10
- "paymentFailure": {
11
- "__typename": "CustomerPaymentFailure",
12
- "active": false,
13
- "startDate": null
14
- },
15
- "subscriptions": [
16
- {
17
- "id": "SUB-0010708341",
18
- "cpn": "4AAA039261010",
19
- "startDate": "2022-09-20T09:44:28",
20
- "endDate": null,
21
- "serviceCancellationDate": null,
22
- "isActive": true,
23
- "status": "Active",
24
- "price": 34.67,
25
- "currency": "GBP",
26
- "type": "Print",
27
- "dtc": false,
28
- "products": [
29
- {
30
- "id": "SUB-0010708341|PKPG-065",
31
- "code": "PKPG-065"
32
- }
33
- ],
34
- "phases": [
35
- {
36
- "id": "SUB-0010708341|InitialCooling",
37
- "type": "Cooling Off",
38
- "active": false,
39
- "startDate": "2022-09-26T00:00:00",
40
- "endDate": "2022-10-10T23:59:59"
41
- },
42
- {
43
- "id": "SUB-0010708341|TM-S01",
44
- "type": "Contract",
45
- "active": false,
46
- "startDate": "2022-10-10T23:59:59",
47
- "endDate": "2022-12-26T00:00:00"
48
- },
49
- {
50
- "id": "SUB-0010708341|TM-S02",
51
- "type": "Rolling",
52
- "active": false,
53
- "startDate": "2022-12-26T00:00:00",
54
- "endDate": null
55
- }
56
- ],
57
- "billingDetails": {
58
- "__typename": "BillingDetails",
59
- "available": true,
60
- "billCycleDay": 26,
61
- "paymentMethod": {
62
- "__typename": "PaymentMethod",
63
- "type": "BankTransfer",
64
- "cardType": null,
65
- "cardNumber": null,
66
- "expirationMonth": null,
67
- "expirationYear": null,
68
- "bankName": "A Bank",
69
- "bankCode": "200000",
70
- "bankTransferAccountNumberMask": "****4247",
71
- "paymentMethodStatus": "Active",
72
- "paypalBaid": null,
73
- "paypalType": null,
74
- "walletType": null
75
- }
76
- },
77
- "nextVoucherBookletDueDate": "2023-09-17",
78
- "nextVoucherInsGenerationDate": "2023-09-10",
79
- "fulfilmentPeriodStartDate": "2023-09-25",
80
- "fulfilmentPeriodEndDate": "2023-12-24",
81
- "freeOfCharge": false,
82
- "deliveryInformation": "On my doorstep",
83
- "__typename": "Subscription"
84
- }
85
- ],
86
- "__typename": "User",
87
- "cpn": "4AAA039261010"
88
- },
89
- "env": { "LOQACCOUNT_KEY": "" }
90
- },
91
- "tenant": "DEMO",
92
- "__N_SSP": true
93
- },
94
- "page": "/account/subscription-and-billing",
95
- "query": {},
96
- "buildId": "development",
97
- "isFallback": false,
98
- "gssp": true,
99
- "appGip": true,
100
- "scriptLoader": []
101
- }