@wordpress/e2e-tests 4.6.0 → 4.7.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.
@@ -1,131 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- activateTheme,
6
- createNewPost,
7
- insertBlock,
8
- pressKeyTimes,
9
- publishPost,
10
- setOption,
11
- trashAllComments,
12
- } from '@wordpress/e2e-test-utils';
13
-
14
- describe( 'Comments', () => {
15
- let previousPageComments,
16
- previousCommentsPerPage,
17
- previousDefaultCommentsPage;
18
- beforeAll( async () => {
19
- await activateTheme( 'emptytheme' );
20
- previousPageComments = await setOption( 'page_comments', '1' );
21
- previousCommentsPerPage = await setOption( 'comments_per_page', '1' );
22
- previousDefaultCommentsPage = await setOption(
23
- 'default_comments_page',
24
- 'newest'
25
- );
26
- } );
27
- it( 'We show no results message if there are no comments', async () => {
28
- await trashAllComments();
29
- await createNewPost();
30
- await insertBlock( 'Comments' );
31
- await page.waitForXPath( '//p[contains(text(), "No results found.")]' );
32
- } );
33
- it( 'Pagination links are working as expected', async () => {
34
- await createNewPost();
35
- await insertBlock( 'Comments' );
36
- await publishPost();
37
- // Visit the post that was just published.
38
- await page.click(
39
- '.post-publish-panel__postpublish-buttons .is-primary'
40
- );
41
-
42
- // TODO: We can extract this into a util once we find we need it elsewhere.
43
- // Create three comments for that post.
44
- for ( let i = 0; i < 3; i++ ) {
45
- await page.waitForSelector( 'textarea#comment' );
46
- await page.click( 'textarea#comment' );
47
- await page.type(
48
- `textarea#comment`,
49
- `This is an automated comment - ${ i }`
50
- );
51
- await pressKeyTimes( 'Tab', 1 );
52
- await Promise.all( [
53
- page.keyboard.press( 'Enter' ),
54
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
55
- ] );
56
- }
57
-
58
- // We check that there is a previous comments page link.
59
- expect(
60
- await page.$( '.wp-block-comments-pagination-previous' )
61
- ).not.toBeNull();
62
- expect(
63
- await page.$( '.wp-block-comments-pagination-next' )
64
- ).toBeNull();
65
-
66
- await Promise.all( [
67
- page.click( '.wp-block-comments-pagination-previous' ),
68
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
69
- ] );
70
-
71
- // We check that there are a previous and a next link.
72
- expect(
73
- await page.$( '.wp-block-comments-pagination-previous' )
74
- ).not.toBeNull();
75
- expect(
76
- await page.$( '.wp-block-comments-pagination-next' )
77
- ).not.toBeNull();
78
-
79
- await Promise.all( [
80
- page.click( '.wp-block-comments-pagination-previous' ),
81
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
82
- ] );
83
-
84
- // We check that there is only have a next link
85
- expect(
86
- await page.$( '.wp-block-comments-pagination-previous' )
87
- ).toBeNull();
88
- expect(
89
- await page.$( '.wp-block-comments-pagination-next' )
90
- ).not.toBeNull();
91
- } );
92
- it( 'Pagination links are not appearing if break comments is not enabled', async () => {
93
- await setOption( 'page_comments', '0' );
94
- await createNewPost();
95
- await insertBlock( 'Comments' );
96
- await publishPost();
97
- // Visit the post that was just published.
98
- await page.click(
99
- '.post-publish-panel__postpublish-buttons .is-primary'
100
- );
101
-
102
- // Create three comments for that post.
103
- for ( let i = 0; i < 3; i++ ) {
104
- await page.waitForSelector( 'textarea#comment' );
105
- await page.click( 'textarea#comment' );
106
- await page.type(
107
- `textarea#comment`,
108
- `This is an automated comment - ${ i }`
109
- );
110
- await pressKeyTimes( 'Tab', 1 );
111
- await Promise.all( [
112
- page.keyboard.press( 'Enter' ),
113
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
114
- ] );
115
- }
116
- // We check that there are no comments page link.
117
- expect(
118
- await page.$( '.wp-block-comments-pagination-previous' )
119
- ).toBeNull();
120
- expect(
121
- await page.$( '.wp-block-comments-pagination-next' )
122
- ).toBeNull();
123
- } );
124
- afterAll( async () => {
125
- await trashAllComments();
126
- await activateTheme( 'twentytwentyone' );
127
- await setOption( 'page_comments', previousPageComments );
128
- await setOption( 'comments_per_page', previousCommentsPerPage );
129
- await setOption( 'default_comments_page', previousDefaultCommentsPage );
130
- } );
131
- } );
@@ -1,542 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- clickBlockAppender,
6
- clickBlockToolbarButton,
7
- getEditedPostContent,
8
- createNewPost,
9
- pressKeyTimes,
10
- transformBlockTo,
11
- pressKeyWithModifier,
12
- insertBlock,
13
- showBlockToolbar,
14
- } from '@wordpress/e2e-test-utils';
15
-
16
- describe( 'List', () => {
17
- beforeEach( async () => {
18
- await createNewPost();
19
- } );
20
-
21
- it( 'can be created by using an asterisk at the start of a paragraph block', async () => {
22
- // Create a block with some text that will trigger a list creation.
23
- await clickBlockAppender();
24
- await page.keyboard.type( '* A list item' );
25
-
26
- // Create a second list item.
27
- await page.keyboard.press( 'Enter' );
28
- await page.keyboard.type( 'Another list item' );
29
-
30
- expect( await getEditedPostContent() ).toMatchSnapshot();
31
- } );
32
-
33
- it( 'can be created by typing an asterisk in front of text of a paragraph block', async () => {
34
- // Create a list with the slash block shortcut.
35
- await clickBlockAppender();
36
- await page.keyboard.type( 'test' );
37
- await pressKeyTimes( 'ArrowLeft', 4 );
38
- await page.keyboard.type( '* ' );
39
-
40
- expect( await getEditedPostContent() ).toMatchSnapshot();
41
- } );
42
-
43
- it( 'can be created by using a number at the start of a paragraph block', async () => {
44
- // Create a block with some text that will trigger a list creation.
45
- await clickBlockAppender();
46
- await page.keyboard.type( '1) A list item' );
47
-
48
- expect( await getEditedPostContent() ).toMatchSnapshot();
49
- } );
50
-
51
- it( 'can undo asterisk transform', async () => {
52
- await clickBlockAppender();
53
- await page.keyboard.type( '1. ' );
54
- await pressKeyWithModifier( 'primary', 'z' );
55
-
56
- expect( await getEditedPostContent() ).toMatchSnapshot();
57
- } );
58
-
59
- it( 'should undo asterisk transform with backspace', async () => {
60
- await clickBlockAppender();
61
- await page.keyboard.type( '* ' );
62
- await page.keyboard.press( 'Backspace' );
63
-
64
- expect( await getEditedPostContent() ).toMatchSnapshot();
65
- } );
66
-
67
- it( 'should undo asterisk transform with backspace after selection changes', async () => {
68
- await clickBlockAppender();
69
- await page.keyboard.type( '* ' );
70
- await page.evaluate( () => new Promise( window.requestIdleCallback ) );
71
- await page.keyboard.press( 'Backspace' );
72
-
73
- expect( await getEditedPostContent() ).toMatchSnapshot();
74
- } );
75
-
76
- it( 'should undo asterisk transform with backspace setting isTyping state', async () => {
77
- await clickBlockAppender();
78
- await page.keyboard.type( '* ' );
79
- await showBlockToolbar();
80
- await page.keyboard.press( 'Backspace' );
81
-
82
- expect( await getEditedPostContent() ).toMatchSnapshot();
83
- } );
84
-
85
- it( 'should undo asterisk transform with backspace after selection changes without requestIdleCallback', async () => {
86
- await clickBlockAppender();
87
- await page.evaluate( () => delete window.requestIdleCallback );
88
- await page.keyboard.type( '* ' );
89
- await new Promise( ( resolve ) => setTimeout( resolve, 100 ) );
90
- await page.keyboard.press( 'Backspace' );
91
-
92
- expect( await getEditedPostContent() ).toMatchSnapshot();
93
- } );
94
-
95
- it( 'should undo asterisk transform with escape', async () => {
96
- await clickBlockAppender();
97
- await page.keyboard.type( '* ' );
98
- await page.keyboard.press( 'Escape' );
99
-
100
- expect( await getEditedPostContent() ).toMatchSnapshot();
101
- } );
102
-
103
- it( 'should not undo asterisk transform with backspace after typing', async () => {
104
- await clickBlockAppender();
105
- await page.keyboard.type( '* a' );
106
- await page.keyboard.press( 'Backspace' );
107
- await page.keyboard.press( 'Backspace' );
108
-
109
- expect( await getEditedPostContent() ).toMatchSnapshot();
110
- } );
111
-
112
- it( 'should not undo asterisk transform with backspace after selection change', async () => {
113
- await clickBlockAppender();
114
- await page.keyboard.press( 'Enter' );
115
- await page.keyboard.type( '* ' );
116
- await page.evaluate( () => new Promise( window.requestIdleCallback ) );
117
- await page.keyboard.press( 'ArrowUp' );
118
- await page.keyboard.press( 'ArrowDown' );
119
- await page.keyboard.press( 'Backspace' );
120
-
121
- // Expect list to be deleted.
122
- expect( await getEditedPostContent() ).toMatchSnapshot();
123
- } );
124
-
125
- it( 'can be created by typing "/list"', async () => {
126
- // Create a list with the slash block shortcut.
127
- await clickBlockAppender();
128
- await page.keyboard.type( '/list' );
129
- await page.waitForXPath(
130
- `//*[contains(@class, "components-autocomplete__result") and contains(@class, "is-selected") and contains(text(), 'List')]`
131
- );
132
- await page.keyboard.press( 'Enter' );
133
- await page.keyboard.type( 'I’m a list' );
134
-
135
- expect( await getEditedPostContent() ).toMatchSnapshot();
136
- } );
137
-
138
- it( 'can be created by converting a paragraph', async () => {
139
- await clickBlockAppender();
140
- await page.keyboard.type( 'test' );
141
- await transformBlockTo( 'List' );
142
-
143
- expect( await getEditedPostContent() ).toMatchSnapshot();
144
- } );
145
-
146
- it( 'can be created by converting multiple paragraphs', async () => {
147
- await clickBlockAppender();
148
- await page.keyboard.type( 'one' );
149
- await page.keyboard.press( 'Enter' );
150
- await page.keyboard.type( 'two' );
151
- await page.keyboard.down( 'Shift' );
152
- await page.click( '[data-type="core/paragraph"]' );
153
- await page.keyboard.up( 'Shift' );
154
- await transformBlockTo( 'List' );
155
-
156
- expect( await getEditedPostContent() ).toMatchSnapshot();
157
- } );
158
-
159
- it( 'can be created by converting a paragraph with line breaks', async () => {
160
- await clickBlockAppender();
161
- await page.keyboard.type( 'one' );
162
- await pressKeyWithModifier( 'shift', 'Enter' );
163
- await page.keyboard.type( 'two' );
164
- await transformBlockTo( 'List' );
165
-
166
- expect( await getEditedPostContent() ).toMatchSnapshot();
167
- } );
168
-
169
- it( 'should not transform lines in block when transforming multiple blocks', async () => {
170
- await clickBlockAppender();
171
- await page.keyboard.type( 'one' );
172
- await pressKeyWithModifier( 'shift', 'Enter' );
173
- await page.keyboard.type( '...' );
174
- await page.keyboard.press( 'Enter' );
175
- await page.keyboard.type( 'two' );
176
- await page.keyboard.down( 'Shift' );
177
- await page.click( '[data-type="core/paragraph"]' );
178
- await page.keyboard.up( 'Shift' );
179
- await transformBlockTo( 'List' );
180
-
181
- expect( await getEditedPostContent() ).toMatchSnapshot();
182
- } );
183
-
184
- it( 'can be converted to paragraphs', async () => {
185
- await insertBlock( 'List' );
186
- await page.keyboard.type( 'one' );
187
- await page.keyboard.press( 'Enter' );
188
- await page.keyboard.type( 'two' );
189
- await transformBlockTo( 'Paragraph' );
190
-
191
- expect( await getEditedPostContent() ).toMatchSnapshot();
192
- } );
193
-
194
- it( 'can be converted when nested to paragraphs', async () => {
195
- await insertBlock( 'List' );
196
- await page.keyboard.type( 'one' );
197
- await page.keyboard.press( 'Enter' );
198
- await clickBlockToolbarButton( 'Indent' );
199
- await page.keyboard.type( 'two' );
200
- await transformBlockTo( 'Paragraph' );
201
-
202
- expect( await getEditedPostContent() ).toMatchSnapshot();
203
- } );
204
-
205
- it( 'can be created by converting a quote', async () => {
206
- await insertBlock( 'Quote' );
207
- await page.keyboard.type( 'one' );
208
- await page.keyboard.press( 'Enter' );
209
- await page.keyboard.type( 'two' );
210
- await transformBlockTo( 'List' );
211
-
212
- expect( await getEditedPostContent() ).toMatchSnapshot();
213
- } );
214
-
215
- it( 'can be converted to a quote', async () => {
216
- await insertBlock( 'List' );
217
- await page.keyboard.type( 'one' );
218
- await page.keyboard.press( 'Enter' );
219
- await page.keyboard.type( 'two' );
220
- await transformBlockTo( 'Quote' );
221
-
222
- expect( await getEditedPostContent() ).toMatchSnapshot();
223
- } );
224
-
225
- it( 'should create paragraph on split at end and merge back with content', async () => {
226
- await insertBlock( 'List' );
227
- await page.keyboard.type( 'one' );
228
- await page.keyboard.press( 'Enter' );
229
- await page.keyboard.press( 'Enter' );
230
-
231
- expect( await getEditedPostContent() ).toMatchSnapshot();
232
-
233
- await page.keyboard.type( 'two' );
234
- await pressKeyTimes( 'ArrowLeft', 'two'.length );
235
- await page.keyboard.press( 'Backspace' );
236
-
237
- expect( await getEditedPostContent() ).toMatchSnapshot();
238
- } );
239
-
240
- it( 'should split into two with paragraph and merge lists', async () => {
241
- await insertBlock( 'List' );
242
- await page.keyboard.type( 'one' );
243
- await page.keyboard.press( 'Enter' );
244
- await page.keyboard.type( 'two' );
245
- await page.keyboard.press( 'ArrowUp' );
246
- await page.keyboard.press( 'Enter' );
247
-
248
- expect( await getEditedPostContent() ).toMatchSnapshot();
249
-
250
- await page.keyboard.press( 'Enter' );
251
-
252
- expect( await getEditedPostContent() ).toMatchSnapshot();
253
-
254
- // Should remove paragraph without creating empty list item.
255
- await page.keyboard.press( 'Backspace' );
256
-
257
- // Should merge lists into one.
258
- await page.keyboard.press( 'ArrowDown' );
259
- await pressKeyTimes( 'ArrowLeft', 'two'.length );
260
-
261
- expect( await getEditedPostContent() ).toMatchSnapshot();
262
- } );
263
-
264
- it( 'should split into two ordered lists with paragraph', async () => {
265
- await clickBlockAppender();
266
- await page.keyboard.type( '1. one' );
267
- await page.keyboard.press( 'Enter' );
268
- await page.keyboard.type( 'two' );
269
- await page.keyboard.press( 'ArrowUp' );
270
- await page.keyboard.press( 'Enter' );
271
- await page.keyboard.press( 'Enter' );
272
-
273
- expect( await getEditedPostContent() ).toMatchSnapshot();
274
- } );
275
-
276
- it( 'should split indented list item', async () => {
277
- await insertBlock( 'List' );
278
- await page.keyboard.type( 'one' );
279
- await page.keyboard.press( 'Enter' );
280
- await clickBlockToolbarButton( 'Indent' );
281
- await page.keyboard.type( 'two' );
282
- await page.keyboard.press( 'Enter' );
283
- await page.keyboard.type( 'three' );
284
-
285
- expect( await getEditedPostContent() ).toMatchSnapshot();
286
- } );
287
-
288
- it( 'should be immeadiately saved on indentation', async () => {
289
- await insertBlock( 'List' );
290
- await page.keyboard.type( 'one' );
291
- await page.keyboard.press( 'Enter' );
292
- await pressKeyWithModifier( 'primary', 'm' );
293
-
294
- expect( await getEditedPostContent() ).toMatchSnapshot();
295
- } );
296
-
297
- it( 'should change the base list type', async () => {
298
- await insertBlock( 'List' );
299
- const button = await page.waitForSelector(
300
- 'button[aria-label="Ordered"]'
301
- );
302
- await button.click();
303
-
304
- expect( await getEditedPostContent() ).toMatchSnapshot();
305
- } );
306
-
307
- it( 'should change the indented list type', async () => {
308
- await insertBlock( 'List' );
309
- await page.keyboard.type( 'a' );
310
- await page.keyboard.press( 'Enter' );
311
- await pressKeyWithModifier( 'primary', 'm' );
312
- await page.keyboard.type( '1' );
313
-
314
- await clickBlockToolbarButton( 'Ordered' );
315
-
316
- expect( await getEditedPostContent() ).toMatchSnapshot();
317
- } );
318
-
319
- it( 'should indent and outdent level 1', async () => {
320
- await insertBlock( 'List' );
321
- await page.keyboard.type( 'a' );
322
- await page.keyboard.press( 'Enter' );
323
- await pressKeyWithModifier( 'primary', 'm' );
324
- await page.keyboard.type( '1' );
325
-
326
- expect( await getEditedPostContent() ).toMatchSnapshot();
327
-
328
- await pressKeyWithModifier( 'primaryShift', 'm' );
329
-
330
- expect( await getEditedPostContent() ).toMatchSnapshot();
331
- } );
332
-
333
- it( 'should indent and outdent level 2', async () => {
334
- await insertBlock( 'List' );
335
- await page.keyboard.type( 'a' );
336
- await page.keyboard.press( 'Enter' );
337
- await pressKeyWithModifier( 'primary', 'm' );
338
- await page.keyboard.type( '1' );
339
- await page.keyboard.press( 'Enter' );
340
- await pressKeyWithModifier( 'primary', 'm' );
341
- await page.keyboard.type( 'i' );
342
-
343
- expect( await getEditedPostContent() ).toMatchSnapshot();
344
-
345
- await pressKeyWithModifier( 'primaryShift', 'm' );
346
-
347
- expect( await getEditedPostContent() ).toMatchSnapshot();
348
-
349
- await pressKeyWithModifier( 'primaryShift', 'm' );
350
-
351
- expect( await getEditedPostContent() ).toMatchSnapshot();
352
- } );
353
-
354
- it( 'should outdent with children', async () => {
355
- await insertBlock( 'List' );
356
- await page.keyboard.type( 'a' );
357
- await page.keyboard.press( 'Enter' );
358
- await pressKeyWithModifier( 'primary', 'm' );
359
- await page.keyboard.type( 'b' );
360
- await page.keyboard.press( 'Enter' );
361
- await pressKeyWithModifier( 'primary', 'm' );
362
- await page.keyboard.type( 'c' );
363
-
364
- expect( await getEditedPostContent() ).toMatchSnapshot();
365
-
366
- await page.keyboard.press( 'ArrowUp' );
367
- await pressKeyWithModifier( 'primaryShift', 'm' );
368
-
369
- expect( await getEditedPostContent() ).toMatchSnapshot();
370
- } );
371
-
372
- it( 'should insert a line break on shift+enter', async () => {
373
- await insertBlock( 'List' );
374
- await page.keyboard.type( 'a' );
375
- await pressKeyWithModifier( 'shift', 'Enter' );
376
-
377
- expect( await getEditedPostContent() ).toMatchSnapshot();
378
- } );
379
-
380
- it( 'should insert a line break on shift+enter in a non trailing list item', async () => {
381
- await insertBlock( 'List' );
382
- await page.keyboard.type( 'a' );
383
- await page.keyboard.press( 'Enter' );
384
- await page.keyboard.type( 'b' );
385
- await page.keyboard.press( 'Enter' );
386
- await page.keyboard.type( 'c' );
387
- await page.keyboard.press( 'ArrowUp' );
388
- await pressKeyWithModifier( 'shift', 'Enter' );
389
-
390
- expect( await getEditedPostContent() ).toMatchSnapshot();
391
- } );
392
-
393
- it( 'should create and remove indented list with keyboard only', async () => {
394
- await clickBlockAppender();
395
-
396
- await page.keyboard.type( '* 1' ); // Should be at level 0.
397
- await page.keyboard.press( 'Enter' );
398
- await page.keyboard.type( ' a' ); // Should be at level 1.
399
- await page.keyboard.press( 'Enter' );
400
- await page.keyboard.type( ' i' ); // Should be at level 2.
401
-
402
- expect( await getEditedPostContent() ).toMatchSnapshot();
403
-
404
- await page.keyboard.press( 'Backspace' );
405
- await page.keyboard.press( 'Backspace' ); // Should be at level 1.
406
-
407
- expect( await getEditedPostContent() ).toMatchSnapshot();
408
-
409
- await page.keyboard.press( 'Backspace' ); // Should be at level 0.
410
-
411
- expect( await getEditedPostContent() ).toMatchSnapshot();
412
-
413
- await page.keyboard.press( 'Backspace' ); // Should be at level 1.
414
-
415
- expect( await getEditedPostContent() ).toMatchSnapshot();
416
-
417
- await page.keyboard.press( 'Backspace' );
418
- await page.keyboard.press( 'Backspace' ); // Should be at level 0.
419
-
420
- expect( await getEditedPostContent() ).toMatchSnapshot();
421
-
422
- await page.keyboard.press( 'Backspace' ); // Should be at level 0.
423
-
424
- expect( await getEditedPostContent() ).toMatchSnapshot();
425
-
426
- await page.keyboard.press( 'Backspace' );
427
- await page.keyboard.press( 'Backspace' ); // Should remove list.
428
-
429
- expect( await getEditedPostContent() ).toMatchSnapshot();
430
-
431
- // That's 9 key presses to create the list, and 9 key presses to remove
432
- // the list. ;)
433
- } );
434
-
435
- it( 'should place the caret in the right place with nested list', async () => {
436
- await clickBlockAppender();
437
- await page.keyboard.type( '* 1' );
438
- await page.keyboard.press( 'Enter' );
439
- await page.keyboard.type( ' a' );
440
- await page.keyboard.press( 'ArrowUp' );
441
- await page.keyboard.press( 'Enter' );
442
- // The caret should land in the second item.
443
- await page.keyboard.type( '2' );
444
-
445
- expect( await getEditedPostContent() ).toMatchSnapshot();
446
- } );
447
-
448
- it( 'should not indent list on space with modifier', async () => {
449
- await clickBlockAppender();
450
-
451
- await page.keyboard.type( '* 1' );
452
- await page.keyboard.press( 'Enter' );
453
- await pressKeyWithModifier( 'shift', 'Space' );
454
-
455
- expect( await getEditedPostContent() ).toMatchSnapshot();
456
- } );
457
-
458
- it( 'should only convert to list when shortcut ends with space', async () => {
459
- await clickBlockAppender();
460
-
461
- // Tests the shortcut with a non breaking space.
462
- await page.keyboard.type( '* ' );
463
-
464
- expect( await getEditedPostContent() ).toMatchSnapshot();
465
- } );
466
-
467
- it( 'should preserve indentation after merging backward and forward', async () => {
468
- await clickBlockAppender();
469
-
470
- // Tests the shortcut with a non breaking space.
471
- await page.keyboard.type( '* 1' );
472
- await page.keyboard.press( 'Enter' );
473
- await page.keyboard.press( 'Space' );
474
- await page.keyboard.type( '2' );
475
- await page.keyboard.press( 'Enter' );
476
- await page.keyboard.type( '3' );
477
-
478
- // Create a new paragraph.
479
- await page.keyboard.press( 'Enter' );
480
- await page.keyboard.press( 'Enter' );
481
-
482
- // Merge the pragraph back. No list items should be joined.
483
- await page.keyboard.press( 'Backspace' );
484
-
485
- expect( await getEditedPostContent() ).toMatchSnapshot();
486
-
487
- // Again create a new paragraph.
488
- await page.keyboard.press( 'Enter' );
489
-
490
- // Move to the end of the list.
491
- await page.keyboard.press( 'ArrowLeft' );
492
-
493
- // Merge forward. No list items should be joined.
494
- await page.keyboard.press( 'Delete' );
495
-
496
- expect( await getEditedPostContent() ).toMatchSnapshot();
497
- } );
498
-
499
- it( 'first empty list item is graciously removed', async () => {
500
- await clickBlockAppender();
501
- await page.keyboard.type( '* 1' );
502
- await page.keyboard.press( 'Enter' );
503
- await page.keyboard.type( '2' );
504
- await page.keyboard.press( 'ArrowUp' );
505
- await page.keyboard.press( 'Backspace' );
506
- await page.keyboard.press( 'Backspace' );
507
-
508
- expect( await getEditedPostContent() ).toMatchSnapshot();
509
- } );
510
-
511
- it( 'should not change the contents when you change the list type to Ordered', async () => {
512
- await clickBlockAppender();
513
- await page.keyboard.type( '* 1' );
514
- await page.keyboard.press( 'Enter' );
515
- await page.keyboard.type( '2' );
516
- await page.keyboard.press( 'Enter' );
517
- await page.keyboard.type( '3' );
518
- await clickBlockToolbarButton( 'Ordered' );
519
-
520
- const content = await page.$eval(
521
- '.wp-block-list',
522
- ( el ) => el.innerHTML
523
- );
524
- expect( content ).toMatchSnapshot();
525
- } );
526
-
527
- it( 'should not change the contents when you change the list type to Unordered', async () => {
528
- await clickBlockAppender();
529
- await page.keyboard.type( '1. a' );
530
- await page.keyboard.press( 'Enter' );
531
- await page.keyboard.type( 'b' );
532
- await page.keyboard.press( 'Enter' );
533
- await page.keyboard.type( 'c' );
534
- await clickBlockToolbarButton( 'Unordered' );
535
-
536
- const content = await page.$eval(
537
- '.wp-block-list',
538
- ( el ) => el.innerHTML
539
- );
540
- expect( content ).toMatchSnapshot();
541
- } );
542
- } );
@@ -1,7 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Using Format API Clicking the control wraps the selected text properly with HTML code 1`] = `
4
- "<!-- wp:paragraph -->
5
- <p>First <a href=\\"https://example.com\\" class=\\"my-plugin-link\\">paragraph</a></p>
6
- <!-- /wp:paragraph -->"
7
- `;