@newskit-render/core 4.27.1-alpha.4 → 4.27.2-alpha.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.
@@ -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
320
 
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
-
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', () => {
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "4.27.1-alpha.4",
3
+ "version": "4.27.2-alpha.0",
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.12.1",
46
46
  "@newskit-render/auth": "^1.8.0",
47
- "@newskit-render/checkout": "^3.9.34-alpha.0",
48
- "@newskit-render/feature-flags": "^1.8.1-alpha.1",
47
+ "@newskit-render/checkout": "^3.9.35-alpha.0",
48
+ "@newskit-render/feature-flags": "^1.8.2-alpha.0",
49
49
  "@newskit-render/feed": "^1.8.9",
50
- "@newskit-render/my-account": "^7.54.0-alpha.1",
51
- "@newskit-render/shared-components": "^4.28.0-alpha.0",
52
- "@newskit-render/standalone-components": "^3.20.27-alpha.0",
50
+ "@newskit-render/my-account": "^7.55.0-alpha.0",
51
+ "@newskit-render/shared-components": "^4.28.1-alpha.0",
52
+ "@newskit-render/standalone-components": "^3.20.28-alpha.0",
53
53
  "@newskit-render/validation": "^1.17.0",
54
54
  "cross-fetch": "3.1.5",
55
55
  "graphql": "16.6.0",