@newskit-render/core 4.26.0-alpha.2 → 4.26.0-alpha.4
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/.eslintrc +2 -1
- package/cypress/e2e/account/SkipToContent.cy.js +2 -1
- package/cypress/e2e/account/account-subscription.cy.js +22 -18
- package/cypress/e2e/account/personal-details.cy.js +156 -87
- package/cypress/e2e/core/home-page.cy.js +1 -1
- package/cypress/e2e/help-hub/article-page.cy.js +16 -12
- package/cypress/e2e/help-hub/landing-page.cy.js +11 -8
- package/cypress/e2e/help-hub/result-page.cy.js +11 -8
- package/package.json +10 -9
- package/pages/index.tsx +1 -2
package/.eslintrc
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"plugins": ["prettier", "@typescript-eslint", "cypress"],
|
|
2
|
+
"plugins": ["prettier", "@typescript-eslint", "cypress", "no-only-tests"],
|
|
3
3
|
"extends": ["airbnb-typescript", "prettier", "plugin:cypress/recommended", "next/core-web-vitals", "next"],
|
|
4
4
|
"parser": "@typescript-eslint/parser",
|
|
5
5
|
"parserOptions": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"rules": {
|
|
16
|
+
"no-only-tests/no-only-tests": "error",
|
|
16
17
|
"object-curly-spacing": ["warn", "always"],
|
|
17
18
|
"no-unused-vars": [
|
|
18
19
|
"warn",
|
|
@@ -5,7 +5,8 @@ describe('SkipToContent', () => {
|
|
|
5
5
|
})
|
|
6
6
|
|
|
7
7
|
it('should take the user to the beginning of the main area', () => {
|
|
8
|
-
cy.get('[data-testid="skip-to-content"]').focus()
|
|
8
|
+
cy.get('[data-testid="skip-to-content"]').focus()
|
|
9
|
+
cy.get('[data-testid="skip-to-content"]').click()
|
|
9
10
|
cy.focused().should('have.id', 'main')
|
|
10
11
|
})
|
|
11
12
|
})
|
|
@@ -81,7 +81,8 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
81
81
|
cy.get('a[href="/account/cancellation"]').should('be.visible').click()
|
|
82
82
|
|
|
83
83
|
cy.get('[type="radio"]').first().check()
|
|
84
|
-
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
84
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
85
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
85
86
|
cy.contains('Are you sure you want to cancel your subscription?')
|
|
86
87
|
cy.contains(
|
|
87
88
|
'You will lose unlimited access to exclusive content and benefits.'
|
|
@@ -95,7 +96,8 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
95
96
|
statusCode: 200,
|
|
96
97
|
body: { data: { cancelSubscription: { success: true } } },
|
|
97
98
|
})
|
|
98
|
-
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
99
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
100
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
99
101
|
cy.get('[data-testid="dialog-content"]').should('be.visible')
|
|
100
102
|
// go back to subscription and billing
|
|
101
103
|
cy.contains('Back to account').click()
|
|
@@ -136,8 +138,10 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
136
138
|
cy.mockConsentAndVisit('/account/cancellation')
|
|
137
139
|
cy.contains('Please tell us why you want to cancel')
|
|
138
140
|
cy.get('[type="radio"]').check('Other')
|
|
139
|
-
cy.get('textarea[name="other"]').clear()
|
|
140
|
-
cy.get('[
|
|
141
|
+
cy.get('textarea[name="other"]').clear()
|
|
142
|
+
cy.get('textarea[name="other"]').type('Thanks my business')
|
|
143
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
144
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
141
145
|
cy.contains('Are you sure you want to cancel your subscription?')
|
|
142
146
|
})
|
|
143
147
|
|
|
@@ -152,11 +156,8 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
152
156
|
date.toISOString()
|
|
153
157
|
)
|
|
154
158
|
cy.get('[data-testid="past-due-banner"]').should('be.visible')
|
|
155
|
-
cy.contains('Your subscription will end soon.')
|
|
156
|
-
cy.get('
|
|
157
|
-
force: true,
|
|
158
|
-
multiple: true,
|
|
159
|
-
})
|
|
159
|
+
cy.contains('Your subscription will end soon.').should('exist')
|
|
160
|
+
cy.get('[data-testid="banner-close-button"]').filter(':visible').click()
|
|
160
161
|
cy.reload()
|
|
161
162
|
cy.get('[data-testid="past-due-banner"]').should('not.exist')
|
|
162
163
|
})
|
|
@@ -236,7 +237,8 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
236
237
|
body: { data: { updateUserSubscription: { success: true } } },
|
|
237
238
|
})
|
|
238
239
|
|
|
239
|
-
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
240
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
241
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
240
242
|
cy.contains(
|
|
241
243
|
'[data-testid="toast-container"]',
|
|
242
244
|
'Updating your delivery instructions'
|
|
@@ -261,22 +263,24 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
261
263
|
'Please note that if you choose a delivery location that is not secure we cannot be liable for lost or stolen newspapers.'
|
|
262
264
|
)
|
|
263
265
|
cy.get('textarea[name="other"]').clear()
|
|
264
|
-
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
266
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
267
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
265
268
|
cy.contains('Please enter your delivery instructions.')
|
|
266
|
-
cy.get('textarea[name="other"]')
|
|
267
|
-
|
|
268
|
-
.
|
|
269
|
-
|
|
270
|
-
)
|
|
269
|
+
cy.get('textarea[name="other"]').clear()
|
|
270
|
+
cy.get('textarea[name="other"]').type(
|
|
271
|
+
'This is more than seventy Characters. Lorem ipsum dolor sit amet, consectetur.'
|
|
272
|
+
)
|
|
271
273
|
cy.contains('You have 0 characters remaining')
|
|
272
|
-
cy.get('textarea[name="other"]').clear()
|
|
274
|
+
cy.get('textarea[name="other"]').clear()
|
|
275
|
+
cy.get('textarea[name="other"]').type('Ring the bell')
|
|
273
276
|
// mock sussesful api call
|
|
274
277
|
cy.intercept('POST', '/api/account/mutate', {
|
|
275
278
|
statusCode: 200,
|
|
276
279
|
body: { data: { updateUserSubscription: { success: true } } },
|
|
277
280
|
})
|
|
278
281
|
|
|
279
|
-
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
282
|
+
cy.get('[data-testid="primary-button"]').scrollIntoView()
|
|
283
|
+
cy.get('[data-testid="primary-button"]').click()
|
|
280
284
|
cy.contains(
|
|
281
285
|
'[data-testid="toast-container"]',
|
|
282
286
|
'Updating your delivery instructions'
|
|
@@ -43,7 +43,7 @@ describe('Personal details with account', () => {
|
|
|
43
43
|
cy.mockConsentAndVisit('/account')
|
|
44
44
|
})
|
|
45
45
|
|
|
46
|
-
it
|
|
46
|
+
it('Should display logged-in user data', () => {
|
|
47
47
|
cy.contains('[data-testid="ContentListIntroduction"]', 'Profile')
|
|
48
48
|
cy.contains('Name')
|
|
49
49
|
cy.contains('John Smith')
|
|
@@ -101,8 +101,10 @@ describe('Personal detail edit pages', () => {
|
|
|
101
101
|
it('Should change user first and last name', () => {
|
|
102
102
|
cy.get('a[href="/account/edit/name"]').should('be.visible').click()
|
|
103
103
|
|
|
104
|
-
cy.get('[name="firstName"]').clear()
|
|
105
|
-
cy.get('[name="
|
|
104
|
+
cy.get('[name="firstName"]').clear()
|
|
105
|
+
cy.get('[name="firstName"]').type('John')
|
|
106
|
+
cy.get('[name="lastName"]').clear()
|
|
107
|
+
cy.get('[name="lastName"]').type('Smith')
|
|
106
108
|
cy.get('[data-testid="primary-button"]').click()
|
|
107
109
|
|
|
108
110
|
cy.contains('[data-testid="toast-container"]', 'Updating your name...')
|
|
@@ -124,13 +126,15 @@ describe('Personal detail edit pages', () => {
|
|
|
124
126
|
cy.get('[data-testid="primary-button"]').click()
|
|
125
127
|
cy.contains('Please enter your First Name')
|
|
126
128
|
|
|
127
|
-
cy.get('[name="firstName"]').clear()
|
|
129
|
+
cy.get('[name="firstName"]').clear()
|
|
130
|
+
cy.get('[name="firstName"]').type('?')
|
|
128
131
|
cy.get('[data-testid="primary-button"]').click()
|
|
129
132
|
cy.contains(
|
|
130
133
|
'Your first name can’t contain special characters. Please try again.'
|
|
131
134
|
)
|
|
132
135
|
|
|
133
|
-
cy.get('[name="firstName"]').clear()
|
|
136
|
+
cy.get('[name="firstName"]').clear()
|
|
137
|
+
cy.get('[name="firstName"]').type('John1')
|
|
134
138
|
cy.get('[data-testid="primary-button"]').click()
|
|
135
139
|
cy.contains(
|
|
136
140
|
'Your first name can’t contain special characters. Please try again.'
|
|
@@ -140,13 +144,15 @@ describe('Personal detail edit pages', () => {
|
|
|
140
144
|
cy.get('[data-testid="primary-button"]').click()
|
|
141
145
|
cy.contains('Please enter your Last Name')
|
|
142
146
|
|
|
143
|
-
cy.get('[name="lastName"]').clear()
|
|
147
|
+
cy.get('[name="lastName"]').clear()
|
|
148
|
+
cy.get('[name="lastName"]').type('?')
|
|
144
149
|
cy.get('[data-testid="primary-button"]').click()
|
|
145
150
|
cy.contains(
|
|
146
151
|
'Your first name can’t contain special characters. Please try again.'
|
|
147
152
|
)
|
|
148
153
|
|
|
149
|
-
cy.get('[name="lastName"]').clear()
|
|
154
|
+
cy.get('[name="lastName"]').clear()
|
|
155
|
+
cy.get('[name="lastName"]').type('Smith1')
|
|
150
156
|
cy.get('[data-testid="primary-button"]').click()
|
|
151
157
|
cy.contains(
|
|
152
158
|
'Your first name can’t contain special characters. Please try again.'
|
|
@@ -169,8 +175,10 @@ describe('Personal detail edit pages', () => {
|
|
|
169
175
|
|
|
170
176
|
cy.get('a[href="/account/edit/name"]').should('be.visible').click()
|
|
171
177
|
|
|
172
|
-
cy.get('[name="firstName"]').clear()
|
|
173
|
-
cy.get('[name="
|
|
178
|
+
cy.get('[name="firstName"]').clear()
|
|
179
|
+
cy.get('[name="firstName"]').type('John')
|
|
180
|
+
cy.get('[name="lastName"]').clear()
|
|
181
|
+
cy.get('[name="lastName"]').type('Smith')
|
|
174
182
|
cy.get('[data-testid="primary-button"]').click()
|
|
175
183
|
|
|
176
184
|
cy.contains('[data-testid="toast-container"]', 'Updating your name...')
|
|
@@ -203,7 +211,8 @@ describe('Personal detail edit pages', () => {
|
|
|
203
211
|
it('Should change user display name', () => {
|
|
204
212
|
cy.get('a[href="/account/edit/displayName"]').should('be.visible').click()
|
|
205
213
|
|
|
206
|
-
cy.get('[name="displayName"]').clear()
|
|
214
|
+
cy.get('[name="displayName"]').clear()
|
|
215
|
+
cy.get('[name="displayName"]').type('JohnSmithNewsUK')
|
|
207
216
|
cy.get('[data-testid="primary-button"]').click()
|
|
208
217
|
|
|
209
218
|
cy.contains(
|
|
@@ -228,7 +237,8 @@ describe('Personal detail edit pages', () => {
|
|
|
228
237
|
cy.get('[data-testid="primary-button"]').click()
|
|
229
238
|
cy.contains('Please enter your Display Name')
|
|
230
239
|
|
|
231
|
-
cy.get('[name="displayName"]').clear()
|
|
240
|
+
cy.get('[name="displayName"]').clear()
|
|
241
|
+
cy.get('[name="displayName"]').type('?')
|
|
232
242
|
cy.get('[data-testid="primary-button"]').click()
|
|
233
243
|
cy.contains(
|
|
234
244
|
'Your Display name can only contain alphanumeric characters, hyphens, apostrophes and spaces'
|
|
@@ -242,7 +252,8 @@ describe('Personal detail edit pages', () => {
|
|
|
242
252
|
).should('not.exist')
|
|
243
253
|
|
|
244
254
|
// Accepts numeric data
|
|
245
|
-
cy.get('[name="displayName"]').clear()
|
|
255
|
+
cy.get('[name="displayName"]').clear()
|
|
256
|
+
cy.get('[name="displayName"]').type('JohnSmithNewsUK1')
|
|
246
257
|
cy.get('[name="displayName"]').blur()
|
|
247
258
|
cy.contains(
|
|
248
259
|
'Your Display name can only contain alphanumeric characters, hyphens, apostrophes and spaces'
|
|
@@ -253,7 +264,8 @@ describe('Personal detail edit pages', () => {
|
|
|
253
264
|
|
|
254
265
|
cy.get('a[href="/account/edit/displayName"]').should('be.visible').click()
|
|
255
266
|
|
|
256
|
-
cy.get('[name="displayName"]').clear()
|
|
267
|
+
cy.get('[name="displayName"]').clear()
|
|
268
|
+
cy.get('[name="displayName"]').type('JohnSmithNewsUK')
|
|
257
269
|
cy.get('[data-testid="primary-button"]').click()
|
|
258
270
|
|
|
259
271
|
cy.contains(
|
|
@@ -297,7 +309,8 @@ describe('Personal detail edit pages', () => {
|
|
|
297
309
|
|
|
298
310
|
cy.get('a[href="/account/edit/email"]').should('be.visible').click()
|
|
299
311
|
|
|
300
|
-
cy.get('[name="email"]').clear()
|
|
312
|
+
cy.get('[name="email"]').clear()
|
|
313
|
+
cy.get('[name="email"]').type(notRegistredEmail)
|
|
301
314
|
cy.get('[data-testid="primary-button"]').click()
|
|
302
315
|
|
|
303
316
|
cy.contains('[data-testid="toast-container"]', 'Updating your email...')
|
|
@@ -324,7 +337,8 @@ describe('Personal detail edit pages', () => {
|
|
|
324
337
|
)
|
|
325
338
|
|
|
326
339
|
// Change email back to the previous email
|
|
327
|
-
cy.get('[name="email"]').clear()
|
|
340
|
+
cy.get('[name="email"]').clear()
|
|
341
|
+
cy.get('[name="email"]').type(currentEmail)
|
|
328
342
|
cy.get('[data-testid="primary-button"]').click()
|
|
329
343
|
})
|
|
330
344
|
it('Should NOT change user email if input value is already registered mail', () => {
|
|
@@ -332,7 +346,8 @@ describe('Personal detail edit pages', () => {
|
|
|
332
346
|
|
|
333
347
|
cy.get('a[href="/account/edit/email"]').should('be.visible').click()
|
|
334
348
|
|
|
335
|
-
cy.get('[name="email"]').clear()
|
|
349
|
+
cy.get('[name="email"]').clear()
|
|
350
|
+
cy.get('[name="email"]').type(alreadyRegistredEmail)
|
|
336
351
|
cy.get('[data-testid="primary-button"]').click()
|
|
337
352
|
|
|
338
353
|
cy.contains('[data-testid="toast-container"]', 'Updating your email...')
|
|
@@ -346,9 +361,10 @@ describe('Personal detail edit pages', () => {
|
|
|
346
361
|
|
|
347
362
|
cy.get('[name="email"]').clear()
|
|
348
363
|
cy.get('[data-testid="primary-button"]').click()
|
|
349
|
-
cy.contains('Please enter your
|
|
364
|
+
cy.contains('Please enter your email address')
|
|
350
365
|
|
|
351
|
-
cy.get('[name="email"]').clear()
|
|
366
|
+
cy.get('[name="email"]').clear()
|
|
367
|
+
cy.get('[name="email"]').type('invalid-email@news')
|
|
352
368
|
cy.get('[data-testid="primary-button"]').click()
|
|
353
369
|
cy.contains(
|
|
354
370
|
'That doesn’t look like a valid email address. Please try again.'
|
|
@@ -366,7 +382,8 @@ describe('Personal detail edit pages', () => {
|
|
|
366
382
|
|
|
367
383
|
cy.get('a[href="/account/edit/email"]').should('be.visible').click()
|
|
368
384
|
|
|
369
|
-
cy.get('[name="email"]').clear()
|
|
385
|
+
cy.get('[name="email"]').clear()
|
|
386
|
+
cy.get('[name="email"]').type('valid-email@news.co.uk')
|
|
370
387
|
cy.get('[data-testid="primary-button"]').click()
|
|
371
388
|
|
|
372
389
|
cy.contains('[data-testid="toast-container"]', 'Updating your email...')
|
|
@@ -469,12 +486,13 @@ describe('Personal detail edit pages', () => {
|
|
|
469
486
|
cy.get('a[href="/account/edit/mobile"]').should('be.visible').click()
|
|
470
487
|
|
|
471
488
|
cy.get('[name="mobileCountry"]').select('United Kingdom')
|
|
472
|
-
cy.get('[name="mobile"]').clear()
|
|
489
|
+
cy.get('[name="mobile"]').clear()
|
|
490
|
+
cy.get('[name="mobile"]').type('070 0012 3456')
|
|
473
491
|
cy.get('[data-testid="primary-button"]').click()
|
|
474
492
|
|
|
475
493
|
cy.contains(
|
|
476
494
|
'[data-testid="toast-container"]',
|
|
477
|
-
'Updating your mobile
|
|
495
|
+
'Updating your mobile number...'
|
|
478
496
|
)
|
|
479
497
|
|
|
480
498
|
// Redirects to Personal details page
|
|
@@ -484,7 +502,7 @@ describe('Personal detail edit pages', () => {
|
|
|
484
502
|
cy.contains('070 0012 3456').should('have.length', 1)
|
|
485
503
|
cy.contains(
|
|
486
504
|
'[data-testid="toast-container"]',
|
|
487
|
-
'Your mobile
|
|
505
|
+
'Your mobile number has been updated.'
|
|
488
506
|
)
|
|
489
507
|
})
|
|
490
508
|
it('Should show input validation error messages when user tries to add invalid mobile number', () => {
|
|
@@ -495,13 +513,15 @@ describe('Personal detail edit pages', () => {
|
|
|
495
513
|
|
|
496
514
|
cy.get('[name="mobile"]').clear()
|
|
497
515
|
cy.get('[data-testid="primary-button"]').click()
|
|
498
|
-
cy.contains('Please enter your mobile
|
|
516
|
+
cy.contains('Please enter your mobile number')
|
|
499
517
|
|
|
500
|
-
cy.get('[name="mobile"]').clear()
|
|
518
|
+
cy.get('[name="mobile"]').clear()
|
|
519
|
+
cy.get('[name="mobile"]').type('stringdata?')
|
|
501
520
|
cy.get('[data-testid="primary-button"]').click()
|
|
502
521
|
cy.get('[name="mobile"]').should('have.value', '')
|
|
503
522
|
|
|
504
|
-
cy.get('[name="mobile"]').clear()
|
|
523
|
+
cy.get('[name="mobile"]').clear()
|
|
524
|
+
cy.get('[name="mobile"]').type('435345')
|
|
505
525
|
cy.get('[data-testid="primary-button"]').click()
|
|
506
526
|
cy.contains(
|
|
507
527
|
'That doesn’t look like a valid phone number. Please try again.'
|
|
@@ -511,7 +531,7 @@ describe('Personal detail edit pages', () => {
|
|
|
511
531
|
cy.get('[data-testid="primary-button"]').click()
|
|
512
532
|
cy.contains(
|
|
513
533
|
'[data-testid="toast-container"]',
|
|
514
|
-
'Updating your mobile
|
|
534
|
+
'Updating your mobile number...'
|
|
515
535
|
).should('not.exist')
|
|
516
536
|
})
|
|
517
537
|
it('Should show error toast when updating mobile number if internal server error occures', () => {
|
|
@@ -519,16 +539,17 @@ describe('Personal detail edit pages', () => {
|
|
|
519
539
|
|
|
520
540
|
cy.get('a[href="/account/edit/mobile"]').should('be.visible').click()
|
|
521
541
|
|
|
522
|
-
cy.get('[name="mobile"]').clear()
|
|
542
|
+
cy.get('[name="mobile"]').clear()
|
|
543
|
+
cy.get('[name="mobile"]').type('070 0012 3456')
|
|
523
544
|
cy.get('[data-testid="primary-button"]').click()
|
|
524
545
|
|
|
525
546
|
cy.contains(
|
|
526
547
|
'[data-testid="toast-container"]',
|
|
527
|
-
'Updating your mobile
|
|
548
|
+
'Updating your mobile number...'
|
|
528
549
|
)
|
|
529
550
|
cy.contains(
|
|
530
551
|
'[data-testid="toast-container"]',
|
|
531
|
-
"Sorry, we're unable to save your mobile
|
|
552
|
+
"Sorry, we're unable to save your mobile number right now. Please try again or come back later."
|
|
532
553
|
)
|
|
533
554
|
})
|
|
534
555
|
})
|
|
@@ -560,12 +581,13 @@ describe('Personal detail edit pages', () => {
|
|
|
560
581
|
cy.get('a[href="/account/edit/landline"]').should('be.visible').click()
|
|
561
582
|
|
|
562
583
|
cy.get('[name="phoneNumberCountry"]').select('United Kingdom')
|
|
563
|
-
cy.get('[name="phoneNumber"]').clear()
|
|
584
|
+
cy.get('[name="phoneNumber"]').clear()
|
|
585
|
+
cy.get('[name="phoneNumber"]').type('020 7782 6000')
|
|
564
586
|
cy.get('[data-testid="primary-button"]').click()
|
|
565
587
|
|
|
566
588
|
cy.contains(
|
|
567
589
|
'[data-testid="toast-container"]',
|
|
568
|
-
'Updating your landline
|
|
590
|
+
'Updating your landline number...'
|
|
569
591
|
)
|
|
570
592
|
|
|
571
593
|
// Redirects to Personal details page
|
|
@@ -575,7 +597,7 @@ describe('Personal detail edit pages', () => {
|
|
|
575
597
|
cy.contains('020 7782 6000').should('have.length', 1)
|
|
576
598
|
cy.contains(
|
|
577
599
|
'[data-testid="toast-container"]',
|
|
578
|
-
'Your landline
|
|
600
|
+
'Your landline number has been updated.'
|
|
579
601
|
)
|
|
580
602
|
})
|
|
581
603
|
it('Should show input validation error messages when user tries to add invalid landline number', () => {
|
|
@@ -586,9 +608,10 @@ describe('Personal detail edit pages', () => {
|
|
|
586
608
|
|
|
587
609
|
cy.get('[name="phoneNumber"]').clear()
|
|
588
610
|
cy.get('[data-testid="primary-button"]').click()
|
|
589
|
-
cy.contains('Please enter your landline
|
|
611
|
+
cy.contains('Please enter your landline number')
|
|
590
612
|
|
|
591
|
-
cy.get('[name="phoneNumber"]').clear()
|
|
613
|
+
cy.get('[name="phoneNumber"]').clear()
|
|
614
|
+
cy.get('[name="phoneNumber"]').type('stringdata?')
|
|
592
615
|
cy.get('[data-testid="primary-button"]').click()
|
|
593
616
|
cy.get('[name="phoneNumber"]').should('have.value', '')
|
|
594
617
|
|
|
@@ -602,7 +625,7 @@ describe('Personal detail edit pages', () => {
|
|
|
602
625
|
cy.get('[data-testid="primary-button"]').click()
|
|
603
626
|
cy.contains(
|
|
604
627
|
'[data-testid="toast-container"]',
|
|
605
|
-
'Updating your landline
|
|
628
|
+
'Updating your landline number...'
|
|
606
629
|
).should('not.exist')
|
|
607
630
|
})
|
|
608
631
|
it('Should show error toast when updating landline number if internal server error occures', () => {
|
|
@@ -610,16 +633,18 @@ describe('Personal detail edit pages', () => {
|
|
|
610
633
|
|
|
611
634
|
cy.get('a[href="/account/edit/landline"]').should('be.visible').click()
|
|
612
635
|
|
|
613
|
-
cy.get('[name="phoneNumber"]').clear()
|
|
636
|
+
cy.get('[name="phoneNumber"]').clear()
|
|
637
|
+
cy.get('[name="phoneNumber"]').type('020 7782 6000')
|
|
638
|
+
|
|
614
639
|
cy.get('[data-testid="primary-button"]').click()
|
|
615
640
|
|
|
616
641
|
cy.contains(
|
|
617
642
|
'[data-testid="toast-container"]',
|
|
618
|
-
'Updating your landline
|
|
643
|
+
'Updating your landline number...'
|
|
619
644
|
)
|
|
620
645
|
cy.contains(
|
|
621
646
|
'[data-testid="toast-container"]',
|
|
622
|
-
"Sorry, we're unable to save your landline
|
|
647
|
+
"Sorry, we're unable to save your landline number right now. Please try again or come back later."
|
|
623
648
|
)
|
|
624
649
|
})
|
|
625
650
|
})
|
|
@@ -666,12 +691,14 @@ describe('Personal detail edit pages', () => {
|
|
|
666
691
|
it('Should change user address', () => {
|
|
667
692
|
cy.get('a[href="/account/edit/address"]').should('be.visible').click()
|
|
668
693
|
|
|
669
|
-
cy.get('input[name="line1"]').clear()
|
|
670
|
-
cy.get('input[name="
|
|
671
|
-
|
|
672
|
-
cy.get('input[name="
|
|
673
|
-
|
|
674
|
-
cy.get('input[name="
|
|
694
|
+
cy.get('input[name="line1"]').clear()
|
|
695
|
+
cy.get('input[name="line1"]').type('News UK')
|
|
696
|
+
cy.get('input[name="line2"]').clear()
|
|
697
|
+
cy.get('input[name="line2"]').type('1 London Bridge Street')
|
|
698
|
+
cy.get('input[name="city"]').clear()
|
|
699
|
+
cy.get('input[name="city"]').type('London')
|
|
700
|
+
cy.get('input[name="postcode"]').clear()
|
|
701
|
+
cy.get('input[name="postcode"]').type('SE1 9GF')
|
|
675
702
|
cy.get('button[name="country"]').click()
|
|
676
703
|
cy.get('[data-testid="United Kingdom"]').first().click() //Why first?
|
|
677
704
|
|
|
@@ -713,7 +740,8 @@ describe('Personal detail edit pages', () => {
|
|
|
713
740
|
cy.get('button[name="country"]').click() // How to clear the country?
|
|
714
741
|
cy.get('[data-testid="Antarctica"]').click()
|
|
715
742
|
|
|
716
|
-
cy.get('input[name="search"]').clear()
|
|
743
|
+
cy.get('input[name="search"]').clear()
|
|
744
|
+
cy.get('input[name="search"]').type('SE1 9GF')
|
|
717
745
|
cy.get('.pcadescription').click({ multiple: true })
|
|
718
746
|
cy.contains('News UK, 1 London Bridge Street').click()
|
|
719
747
|
|
|
@@ -754,13 +782,18 @@ describe('Personal detail edit pages', () => {
|
|
|
754
782
|
it('Should show input validation error messages when user tries to add invalid address', () => {
|
|
755
783
|
cy.get('a[href="/account/edit/address"]').should('be.visible').click()
|
|
756
784
|
|
|
757
|
-
cy.get('input[name="line1"]').clear()
|
|
785
|
+
cy.get('input[name="line1"]').clear()
|
|
786
|
+
cy.get('input[name="line1"]').blur()
|
|
758
787
|
cy.contains('Please enter your first line of your address')
|
|
759
|
-
cy.get('input[name="line2"]').clear()
|
|
760
|
-
cy.get('input[name="
|
|
761
|
-
cy.get('input[name="
|
|
788
|
+
cy.get('input[name="line2"]').clear()
|
|
789
|
+
cy.get('input[name="line2"]').blur()
|
|
790
|
+
cy.get('input[name="line3"]').clear()
|
|
791
|
+
cy.get('input[name="line3"]').blur()
|
|
792
|
+
cy.get('input[name="city"]').clear()
|
|
793
|
+
cy.get('input[name="city"]').blur()
|
|
762
794
|
cy.contains('Please enter your Town/City')
|
|
763
|
-
cy.get('input[name="postcode"]').clear()
|
|
795
|
+
cy.get('input[name="postcode"]').clear()
|
|
796
|
+
cy.get('input[name="postcode"]').blur()
|
|
764
797
|
cy.contains('Please enter your Postcode')
|
|
765
798
|
|
|
766
799
|
//TODO: What kind of other validations exist in the form address?
|
|
@@ -781,10 +814,14 @@ describe('Personal detail edit pages', () => {
|
|
|
781
814
|
|
|
782
815
|
cy.get('a[href="/account/edit/address"]').should('be.visible').click()
|
|
783
816
|
|
|
784
|
-
cy.get('input[name="line1"]').clear()
|
|
785
|
-
cy.get('input[name="
|
|
786
|
-
cy.get('input[name="
|
|
787
|
-
cy.get('input[name="
|
|
817
|
+
cy.get('input[name="line1"]').clear()
|
|
818
|
+
cy.get('input[name="line1"]').type('News UK')
|
|
819
|
+
cy.get('input[name="line2"]').clear()
|
|
820
|
+
cy.get('input[name="line2"]').type('1 London Bridge Street')
|
|
821
|
+
cy.get('input[name="city"]').clear()
|
|
822
|
+
cy.get('input[name="city"]').type('London')
|
|
823
|
+
cy.get('input[name="postcode"]').clear()
|
|
824
|
+
cy.get('input[name="postcode"]').type('SE1 9GF')
|
|
788
825
|
cy.get('button[name="country"]').click()
|
|
789
826
|
cy.get('[data-testid="United Kingdom"]').first().click() //Why first?
|
|
790
827
|
|
|
@@ -801,10 +838,14 @@ describe('Personal detail edit pages', () => {
|
|
|
801
838
|
cy.GetTnlAcsSession('printVouchers')
|
|
802
839
|
cy.mockConsentAndVisit('/account/edit/address')
|
|
803
840
|
|
|
804
|
-
cy.get('input[name="line1"]').clear()
|
|
805
|
-
cy.get('input[name="
|
|
806
|
-
cy.get('input[name="
|
|
807
|
-
cy.get('input[name="
|
|
841
|
+
cy.get('input[name="line1"]').clear()
|
|
842
|
+
cy.get('input[name="line1"]').type('620 Atlantic Ave')
|
|
843
|
+
cy.get('input[name="line2"]').clear()
|
|
844
|
+
cy.get('input[name="line2"]').type('Brooklyn')
|
|
845
|
+
cy.get('input[name="city"]').clear()
|
|
846
|
+
cy.get('input[name="city"]').type('New York')
|
|
847
|
+
cy.get('input[name="postcode"]').clear()
|
|
848
|
+
cy.get('input[name="postcode"]').type('11217')
|
|
808
849
|
|
|
809
850
|
cy.get('[data-testid="select-country"]').click()
|
|
810
851
|
cy.get('[data-testid="United Kingdom"]').should('be.visible')
|
|
@@ -840,9 +881,12 @@ describe('Personal detail edit pages', () => {
|
|
|
840
881
|
|
|
841
882
|
cy.get('a[href="/account/edit/address"]').click()
|
|
842
883
|
|
|
843
|
-
cy.get('input[name="line1"]').clear()
|
|
844
|
-
cy.get('input[name="
|
|
845
|
-
cy.get('input[name="
|
|
884
|
+
cy.get('input[name="line1"]').clear()
|
|
885
|
+
cy.get('input[name="line1"]').type('Buckingham Palace')
|
|
886
|
+
cy.get('input[name="city"]').clear()
|
|
887
|
+
cy.get('input[name="city"]').type('London')
|
|
888
|
+
cy.get('input[name="postcode"]').clear()
|
|
889
|
+
cy.get('input[name="postcode"]').type('SW1A')
|
|
846
890
|
|
|
847
891
|
cy.contains('Save').click()
|
|
848
892
|
|
|
@@ -873,9 +917,12 @@ describe('Personal detail edit pages', () => {
|
|
|
873
917
|
|
|
874
918
|
cy.get('a[href="/account/edit/address"]').click()
|
|
875
919
|
|
|
876
|
-
cy.get('input[name="line1"]').clear()
|
|
877
|
-
cy.get('input[name="
|
|
878
|
-
cy.get('input[name="
|
|
920
|
+
cy.get('input[name="line1"]').clear()
|
|
921
|
+
cy.get('input[name="line1"]').type('1 London Bridge Street')
|
|
922
|
+
cy.get('input[name="city"]').clear()
|
|
923
|
+
cy.get('input[name="city"]').type('London')
|
|
924
|
+
cy.get('input[name="postcode"]').clear()
|
|
925
|
+
cy.get('input[name="postcode"]').type('SE1')
|
|
879
926
|
|
|
880
927
|
cy.contains('Save').click()
|
|
881
928
|
|
|
@@ -904,10 +951,14 @@ describe('Personal detail edit pages', () => {
|
|
|
904
951
|
cy.GetTnlAcsSession('digiprintVouchers')
|
|
905
952
|
cy.mockConsentAndVisit('/account/edit/address')
|
|
906
953
|
|
|
907
|
-
cy.get('input[name="line1"]').clear()
|
|
908
|
-
cy.get('input[name="
|
|
909
|
-
cy.get('input[name="
|
|
910
|
-
cy.get('input[name="
|
|
954
|
+
cy.get('input[name="line1"]').clear()
|
|
955
|
+
cy.get('input[name="line1"]').type('620 Atlantic Ave')
|
|
956
|
+
cy.get('input[name="line2"]').clear()
|
|
957
|
+
cy.get('input[name="line2"]').type('Brooklyn')
|
|
958
|
+
cy.get('input[name="city"]').clear()
|
|
959
|
+
cy.get('input[name="city"]').type('New York')
|
|
960
|
+
cy.get('input[name="postcode"]').clear()
|
|
961
|
+
cy.get('input[name="postcode"]').type('11217')
|
|
911
962
|
|
|
912
963
|
cy.get('[data-testid="select-country"]').click()
|
|
913
964
|
cy.get('[data-testid="United Kingdom"]').should('be.visible')
|
|
@@ -943,11 +994,16 @@ describe('Personal detail edit pages', () => {
|
|
|
943
994
|
|
|
944
995
|
cy.get('a[href="/account/edit/address"]').click()
|
|
945
996
|
|
|
946
|
-
cy.get('input[name="line1"]').clear()
|
|
947
|
-
cy.get('input[name="
|
|
948
|
-
cy.get('input[name="
|
|
949
|
-
cy.get('input[name="
|
|
950
|
-
cy.get('input[name="
|
|
997
|
+
cy.get('input[name="line1"]').clear()
|
|
998
|
+
cy.get('input[name="line1"]').type('2 Tuke House')
|
|
999
|
+
cy.get('input[name="line2"]').clear()
|
|
1000
|
+
cy.get('input[name="line2"]').type('Cromwell Road')
|
|
1001
|
+
cy.get('input[name="city"]').clear()
|
|
1002
|
+
cy.get('input[name="city"]').type('York')
|
|
1003
|
+
cy.get('input[name="county"]').clear()
|
|
1004
|
+
cy.get('input[name="county"]').type('North Yorkshire')
|
|
1005
|
+
cy.get('input[name="postcode"]').clear()
|
|
1006
|
+
cy.get('input[name="postcode"]').type('YO1 6DJ')
|
|
951
1007
|
|
|
952
1008
|
cy.contains('Save').click()
|
|
953
1009
|
|
|
@@ -977,10 +1033,14 @@ describe('Personal detail edit pages', () => {
|
|
|
977
1033
|
|
|
978
1034
|
cy.get('a[href="/account/edit/address"]').click()
|
|
979
1035
|
|
|
980
|
-
cy.get('input[name="line1"]').clear()
|
|
981
|
-
cy.get('input[name="
|
|
982
|
-
cy.get('input[name="
|
|
983
|
-
cy.get('input[name="
|
|
1036
|
+
cy.get('input[name="line1"]').clear()
|
|
1037
|
+
cy.get('input[name="line1"]').type('Harpercollins Publishers')
|
|
1038
|
+
cy.get('input[name="line2"]').clear()
|
|
1039
|
+
cy.get('input[name="line2"]').type('1 London Bridge Street')
|
|
1040
|
+
cy.get('input[name="city"]').clear()
|
|
1041
|
+
cy.get('input[name="city"]').type('London')
|
|
1042
|
+
cy.get('input[name="postcode"]').clear()
|
|
1043
|
+
cy.get('input[name="postcode"]').type('SE1')
|
|
984
1044
|
|
|
985
1045
|
cy.contains('Save').click()
|
|
986
1046
|
|
|
@@ -1010,15 +1070,20 @@ describe('Personal detail edit pages', () => {
|
|
|
1010
1070
|
|
|
1011
1071
|
cy.get('a[href="/account/edit/address"]').click()
|
|
1012
1072
|
|
|
1013
|
-
cy.get('input[name="line1"]').clear()
|
|
1014
|
-
cy.get('input[name="
|
|
1015
|
-
cy.get('input[name="
|
|
1016
|
-
cy.get('input[name="
|
|
1073
|
+
cy.get('input[name="line1"]').clear()
|
|
1074
|
+
cy.get('input[name="line1"]').type('620 Atlantic Ave')
|
|
1075
|
+
cy.get('input[name="line2"]').clear()
|
|
1076
|
+
cy.get('input[name="line2"]').type('Brooklyn')
|
|
1077
|
+
cy.get('input[name="city"]').clear()
|
|
1078
|
+
cy.get('input[name="city"]').type('New York')
|
|
1079
|
+
cy.get('input[name="postcode"]').clear()
|
|
1080
|
+
cy.get('input[name="postcode"]').type('11217')
|
|
1017
1081
|
|
|
1018
1082
|
cy.get('[data-testid="select-country"]').click()
|
|
1019
1083
|
cy.get('[data-testid="United Kingdom"]').should('be.visible')
|
|
1020
|
-
|
|
1021
|
-
|
|
1084
|
+
cy.get('[data-testid="select-panel"]').within(() => {
|
|
1085
|
+
cy.get('[data-testid="United States of America"]').click()
|
|
1086
|
+
})
|
|
1022
1087
|
|
|
1023
1088
|
cy.contains('Save').click()
|
|
1024
1089
|
|
|
@@ -1048,10 +1113,14 @@ describe('Personal detail edit pages', () => {
|
|
|
1048
1113
|
|
|
1049
1114
|
cy.get('a[href="/account/edit/address"]').click()
|
|
1050
1115
|
|
|
1051
|
-
cy.get('input[name="line1"]').clear()
|
|
1052
|
-
cy.get('input[name="
|
|
1053
|
-
cy.get('input[name="
|
|
1054
|
-
cy.get('input[name="
|
|
1116
|
+
cy.get('input[name="line1"]').clear()
|
|
1117
|
+
cy.get('input[name="line1"]').type('News UK')
|
|
1118
|
+
cy.get('input[name="line2"]').clear()
|
|
1119
|
+
cy.get('input[name="line2"]').type('1 London Bridge Street')
|
|
1120
|
+
cy.get('input[name="city"]').clear()
|
|
1121
|
+
cy.get('input[name="city"]').type('London')
|
|
1122
|
+
cy.get('input[name="postcode"]').clear()
|
|
1123
|
+
cy.get('input[name="postcode"]').type('SE1')
|
|
1055
1124
|
|
|
1056
1125
|
cy.contains('Save').click()
|
|
1057
1126
|
|
|
@@ -23,13 +23,15 @@ describe('Help Hub Article Page Search bar', () => {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
it('Should be able to search the results from search bar', () => {
|
|
26
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
26
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
27
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
27
28
|
cy.get('[data-testid="autocomplete-panel"]').should('exist')
|
|
28
29
|
})
|
|
29
30
|
|
|
30
31
|
it('Should able type in searchbar and clear the text', () => {
|
|
31
32
|
cy.get('[data-testid="clear-button"]').should('not.exist')
|
|
32
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
33
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
34
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
33
35
|
cy.get('[data-testid="autocomplete-input"]').should('have.value', 'google')
|
|
34
36
|
cy.get('[data-testid="clear-button"]').should('exist')
|
|
35
37
|
cy.get('[data-testid="clear-button"]').click()
|
|
@@ -40,7 +42,8 @@ describe('Help Hub Article Page Search bar', () => {
|
|
|
40
42
|
it('Should redirect to result page on clicking the search icon', () => {
|
|
41
43
|
cy.get('[data-testid="search-button"]').should('exist')
|
|
42
44
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
43
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
45
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
46
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
44
47
|
cy.get('[data-testid="search-button"]').should('be.visible').click()
|
|
45
48
|
cy.url().should('eq', 'http://localhost:3000/help-hub/results?q=google')
|
|
46
49
|
})
|
|
@@ -64,25 +67,26 @@ describe('Help Hub Article Page Search bar', () => {
|
|
|
64
67
|
|
|
65
68
|
it('Should redirect to article page on clicking the item from search bar dropdown list', () => {
|
|
66
69
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
67
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
70
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
71
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
68
72
|
cy.get('[id="autocomplete-0-item-0"]').should('be.visible').click()
|
|
69
73
|
cy.location('href').should('include', '/article')
|
|
70
74
|
})
|
|
71
75
|
|
|
72
76
|
it('Should redirect to result page on pressing the enter key', () => {
|
|
73
77
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
74
|
-
cy.get('[data-testid="autocomplete-input"]')
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.type('{enter}')
|
|
78
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
79
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
80
|
+
cy.get('[data-testid="autocomplete-input"]').type('{enter}')
|
|
78
81
|
cy.location('href').should('include', '/result')
|
|
79
82
|
})
|
|
80
83
|
it('Should sanitize the search query', () => {
|
|
81
84
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
82
|
-
cy.get('[data-testid="autocomplete-input"]')
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
86
|
+
cy.get('[data-testid="autocomplete-input"]').type(
|
|
87
|
+
'<script>alert(1)</script>'
|
|
88
|
+
)
|
|
89
|
+
cy.get('[data-testid="autocomplete-input"]').type('{enter}')
|
|
86
90
|
cy.location('href').should(
|
|
87
91
|
'include',
|
|
88
92
|
'<script>alert(1)</script>'
|
|
@@ -23,13 +23,15 @@ describe('Help Hub Landing Page Search bar', () => {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
it('Should be able to search the results from search bar', () => {
|
|
26
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
26
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
27
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
27
28
|
cy.get('[data-testid="autocomplete-panel"]').should('exist')
|
|
28
29
|
})
|
|
29
30
|
|
|
30
31
|
it('Should able type in searchbar and clear the text', () => {
|
|
31
32
|
cy.get('[data-testid="clear-button"]').should('not.exist')
|
|
32
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
33
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
34
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
33
35
|
cy.get('[data-testid="autocomplete-input"]').should('have.value', 'google')
|
|
34
36
|
cy.get('[data-testid="clear-button"]').should('exist')
|
|
35
37
|
cy.get('[data-testid="clear-button"]').click()
|
|
@@ -40,7 +42,8 @@ describe('Help Hub Landing Page Search bar', () => {
|
|
|
40
42
|
it('Should redirect to result page on clicking the search icon', () => {
|
|
41
43
|
cy.get('[data-testid="search-button"]').should('exist')
|
|
42
44
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
43
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
45
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
46
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
44
47
|
cy.get('[data-testid="search-button"]').should('be.visible').click()
|
|
45
48
|
cy.url().should('eq', 'http://localhost:3000/help-hub/results?q=google')
|
|
46
49
|
})
|
|
@@ -64,17 +67,17 @@ describe('Help Hub Landing Page Search bar', () => {
|
|
|
64
67
|
|
|
65
68
|
it('Should redirect to article page on clicking the item from search bar dropdown list', () => {
|
|
66
69
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
67
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
70
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
71
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
68
72
|
cy.get('[id="autocomplete-0-item-0"]').should('be.visible').click()
|
|
69
73
|
cy.location('href').should('include', '/article')
|
|
70
74
|
})
|
|
71
75
|
|
|
72
76
|
it('Should redirect to result page on pressing the enter key', () => {
|
|
73
77
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
74
|
-
cy.get('[data-testid="autocomplete-input"]')
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.type('{enter}')
|
|
78
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
79
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
80
|
+
cy.get('[data-testid="autocomplete-input"]').type('{enter}')
|
|
78
81
|
cy.location('href').should('include', '/result')
|
|
79
82
|
})
|
|
80
83
|
})
|
|
@@ -23,13 +23,15 @@ describe('Help Hub Result Page Search bar', () => {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
it('Should be able to search the results from search bar', () => {
|
|
26
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
26
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
27
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
27
28
|
cy.get('[data-testid="autocomplete-panel"]').should('exist')
|
|
28
29
|
})
|
|
29
30
|
|
|
30
31
|
it('Should able type in searchbar and clear the text', () => {
|
|
31
32
|
cy.get('[data-testid="clear-button"]').should('not.exist')
|
|
32
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
33
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
34
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
33
35
|
cy.get('[data-testid="autocomplete-input"]').should('have.value', 'google')
|
|
34
36
|
cy.get('[data-testid="clear-button"]').should('exist')
|
|
35
37
|
cy.get('[data-testid="clear-button"]').click()
|
|
@@ -40,7 +42,8 @@ describe('Help Hub Result Page Search bar', () => {
|
|
|
40
42
|
it('Should redirect to result page on clicking the search icon', () => {
|
|
41
43
|
cy.get('[data-testid="search-button"]').should('exist')
|
|
42
44
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
43
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
45
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
46
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
44
47
|
cy.get('[data-testid="search-button"]').should('be.visible').click()
|
|
45
48
|
cy.url().should('eq', 'http://localhost:3000/help-hub/results?q=google')
|
|
46
49
|
})
|
|
@@ -62,17 +65,17 @@ describe('Help Hub Result Page Search bar', () => {
|
|
|
62
65
|
|
|
63
66
|
it('Should redirect to article page on clicking the item from search bar dropdown list', () => {
|
|
64
67
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
65
|
-
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
68
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
69
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
66
70
|
cy.get('[id="autocomplete-0-item-0"]').should('be.visible').click()
|
|
67
71
|
cy.location('href').should('include', '/article')
|
|
68
72
|
})
|
|
69
73
|
|
|
70
74
|
it('Should redirect to result page on pressing the enter key', () => {
|
|
71
75
|
cy.get('[data-testid="autocomplete-input"]').should('exist')
|
|
72
|
-
cy.get('[data-testid="autocomplete-input"]')
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
.type('{enter}')
|
|
76
|
+
cy.get('[data-testid="autocomplete-input"]').clear()
|
|
77
|
+
cy.get('[data-testid="autocomplete-input"]').type('google')
|
|
78
|
+
cy.get('[data-testid="autocomplete-input"]').type('{enter}')
|
|
76
79
|
cy.location('href').should('include', '/result')
|
|
77
80
|
})
|
|
78
81
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "4.26.0-alpha.
|
|
3
|
+
"version": "4.26.0-alpha.4",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@newrelic/winston-enricher": "4.0.1",
|
|
45
45
|
"@newskit-render/api": "^1.11.0",
|
|
46
46
|
"@newskit-render/auth": "^1.8.0",
|
|
47
|
-
"@newskit-render/checkout": "^3.9.
|
|
47
|
+
"@newskit-render/checkout": "^3.9.25-alpha.0",
|
|
48
48
|
"@newskit-render/feature-flags": "^1.7.0",
|
|
49
49
|
"@newskit-render/feed": "^1.8.5",
|
|
50
|
-
"@newskit-render/my-account": "^7.47.0-alpha.
|
|
51
|
-
"@newskit-render/shared-components": "^4.23.
|
|
52
|
-
"@newskit-render/standalone-components": "^3.20.
|
|
53
|
-
"@newskit-render/validation": "^1.
|
|
50
|
+
"@newskit-render/my-account": "^7.47.0-alpha.2",
|
|
51
|
+
"@newskit-render/shared-components": "^4.23.4-alpha.0",
|
|
52
|
+
"@newskit-render/standalone-components": "^3.20.18-alpha.0",
|
|
53
|
+
"@newskit-render/validation": "^1.17.0-alpha.0",
|
|
54
54
|
"cross-fetch": "3.1.5",
|
|
55
55
|
"graphql": "16.6.0",
|
|
56
56
|
"lodash.get": "4.4.2",
|
|
@@ -83,16 +83,17 @@
|
|
|
83
83
|
"@typescript-eslint/parser": "5.51.0",
|
|
84
84
|
"axe-core": "4.3.4",
|
|
85
85
|
"babel-jest": "26.3.0",
|
|
86
|
-
"cypress": "
|
|
87
|
-
"cypress-axe": "1.
|
|
86
|
+
"cypress": "13.8.1",
|
|
87
|
+
"cypress-axe": "1.5.0",
|
|
88
88
|
"eslint": "8.34.0",
|
|
89
89
|
"eslint-config-airbnb": "19.0.4",
|
|
90
90
|
"eslint-config-airbnb-typescript": "17.0.0",
|
|
91
91
|
"eslint-config-next": "13.1.2",
|
|
92
92
|
"eslint-config-prettier": "8.6.0",
|
|
93
93
|
"eslint-import-resolver-typescript": "3.5.2",
|
|
94
|
-
"eslint-plugin-cypress": "
|
|
94
|
+
"eslint-plugin-cypress": "3.0.1",
|
|
95
95
|
"eslint-plugin-flowtype": "8.0.3",
|
|
96
|
+
"eslint-plugin-no-only-tests": "3.1.0",
|
|
96
97
|
"eslint-plugin-prettier": "4.2.1",
|
|
97
98
|
"jest": "29.7.0",
|
|
98
99
|
"jest-environment-jsdom": "29.7.0",
|
package/pages/index.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Block, TextBlock } from 'newskit'
|
|
2
|
-
import { replaceConsoleAndSetTransactionName } from '../helpers/logger'
|
|
3
2
|
|
|
4
3
|
const HomePage = () => {
|
|
5
4
|
return (
|
|
@@ -12,7 +11,7 @@ const HomePage = () => {
|
|
|
12
11
|
}}
|
|
13
12
|
>
|
|
14
13
|
<TextBlock typographyPreset="editorialHeadline080" stylePreset="inkBase">
|
|
15
|
-
Welcome to
|
|
14
|
+
Welcome to newskit-render
|
|
16
15
|
</TextBlock>
|
|
17
16
|
</Block>
|
|
18
17
|
)
|