@wordpress/e2e-tests 5.0.0 → 5.0.1-next.957ca95e4c.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.
- package/package.json +7 -7
- package/specs/editor/blocks/navigation.test.js +4 -6
- package/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap +3 -1
- package/specs/editor/plugins/inner-blocks-allowed-blocks.test.js +3 -0
- package/specs/editor/various/__snapshots__/block-deletion.test.js.snap +3 -1
- package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +0 -6
- package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +25 -1
- package/specs/editor/various/__snapshots__/rich-text.test.js.snap +19 -5
- package/specs/editor/various/__snapshots__/writing-flow.test.js.snap +3 -11
- package/specs/editor/various/block-switcher.test.js +11 -3
- package/specs/editor/various/inserting-blocks.test.js +4 -0
- package/specs/editor/various/keep-styles-on-block-transforms.test.js +0 -17
- package/specs/editor/various/multi-block-selection.test.js +8 -0
- package/specs/editor/various/rich-text.test.js +9 -6
- package/specs/editor/various/splitting-merging.test.js +7 -2
- package/specs/editor/various/toolbar-roving-tabindex.test.js +2 -1
- package/specs/editor/various/writing-flow.test.js +8 -4
- package/specs/editor/plugins/register-block-type-hooks.test.js +0 -32
- package/specs/editor/various/__snapshots__/duplicating-blocks.test.js.snap +0 -21
- package/specs/editor/various/duplicating-blocks.test.js +0 -47
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "5.0.0",
|
3
|
+
"version": "5.0.1-next.957ca95e4c.0",
|
4
4
|
"description": "End-To-End (E2E) tests for WordPress.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -23,11 +23,11 @@
|
|
23
23
|
"node": ">=14"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@wordpress/e2e-test-utils": "^8.0.0",
|
27
|
-
"@wordpress/jest-console": "^6.0.0",
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^5.0.0",
|
29
|
-
"@wordpress/scripts": "^24.0.0",
|
30
|
-
"@wordpress/url": "^3.17.0",
|
26
|
+
"@wordpress/e2e-test-utils": "^8.0.1-next.957ca95e4c.0",
|
27
|
+
"@wordpress/jest-console": "^6.0.1-next.957ca95e4c.0",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^5.0.1-next.957ca95e4c.0",
|
29
|
+
"@wordpress/scripts": "^24.0.1-next.957ca95e4c.0",
|
30
|
+
"@wordpress/url": "^3.17.1-next.957ca95e4c.0",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "272a74bbbaab10ee24424eafe9578e705fbfbbb4"
|
50
50
|
}
|
@@ -278,8 +278,9 @@ async function waitForBlock( blockName ) {
|
|
278
278
|
}
|
279
279
|
|
280
280
|
// Disable reason - these tests are to be re-written.
|
281
|
+
// Skipped temporarily due to issues with GH actions: https://wordpress.slack.com/archives/C02QB2JS7/p1661331673166269.
|
281
282
|
// eslint-disable-next-line jest/no-disabled-tests
|
282
|
-
describe( 'Navigation', () => {
|
283
|
+
describe.skip( 'Navigation', () => {
|
283
284
|
const contributorUsername = `contributoruser_${ ++uniqueId }`;
|
284
285
|
let contributorPassword;
|
285
286
|
|
@@ -1681,10 +1682,7 @@ Expected mock function not to be called but it was called with: ["POST", "http:/
|
|
1681
1682
|
);
|
1682
1683
|
} );
|
1683
1684
|
|
1684
|
-
|
1685
|
-
// checking for focus consistently fails in the test.
|
1686
|
-
// eslint-disable-next-line jest/no-disabled-tests
|
1687
|
-
it.skip( 'should always focus select menu button after item selection', async () => {
|
1685
|
+
it( 'should always focus select menu button after item selection', async () => {
|
1688
1686
|
// Create some navigation menus to work with.
|
1689
1687
|
await createNavigationMenu( {
|
1690
1688
|
title: 'First navigation',
|
@@ -1712,7 +1710,7 @@ Expected mock function not to be called but it was called with: ["POST", "http:/
|
|
1712
1710
|
const theOption = await page.waitForXPath(
|
1713
1711
|
"//button[@aria-checked='false'][contains(., 'First navigation')]"
|
1714
1712
|
);
|
1715
|
-
theOption.click();
|
1713
|
+
await theOption.click();
|
1716
1714
|
|
1717
1715
|
// Once the options are closed, does select menu button receive focus?
|
1718
1716
|
const selectMenuDropdown2 = await page.$(
|
@@ -84,7 +84,9 @@ exports[`cpt locking template_lock false should allow blocks to be inserted 1`]
|
|
84
84
|
<!-- /wp:columns -->
|
85
85
|
|
86
86
|
<!-- wp:list -->
|
87
|
-
<ul
|
87
|
+
<ul><!-- wp:list-item -->
|
88
|
+
<li>List content</li>
|
89
|
+
<!-- /wp:list-item --></ul>
|
88
90
|
<!-- /wp:list -->"
|
89
91
|
`;
|
90
92
|
|
@@ -75,6 +75,9 @@ describe( 'Allowed Blocks Setting on InnerBlocks', () => {
|
|
75
75
|
await page.$x( `//button//span[contains(text(), 'List')]` )
|
76
76
|
)[ 0 ];
|
77
77
|
await insertButton.click();
|
78
|
+
// Select the list wrapper so the image is inserable.
|
79
|
+
await page.keyboard.press( 'ArrowUp' );
|
80
|
+
await page.keyboard.press( 'ArrowUp' );
|
78
81
|
await insertBlock( 'Image' );
|
79
82
|
await closeGlobalBlockInserter();
|
80
83
|
await page.waitForSelector( '.product[data-number-of-children="2"]' );
|
@@ -24,7 +24,9 @@ exports[`block deletion - deleting the third and fourth blocks using backspace w
|
|
24
24
|
<!-- /wp:paragraph -->
|
25
25
|
|
26
26
|
<!-- wp:list -->
|
27
|
-
<ul
|
27
|
+
<ul><!-- wp:list-item -->
|
28
|
+
<li>caret was here</li>
|
29
|
+
<!-- /wp:list-item --></ul>
|
28
30
|
<!-- /wp:list -->"
|
29
31
|
`;
|
30
32
|
|
@@ -6,12 +6,6 @@ exports[`Keep styles on block transforms Should keep colors during a transform 1
|
|
6
6
|
<!-- /wp:paragraph -->"
|
7
7
|
`;
|
8
8
|
|
9
|
-
exports[`Keep styles on block transforms Should keep the font size during a transform from multiple blocks into a single one 1`] = `
|
10
|
-
"<!-- wp:list {\\"fontSize\\":\\"large\\"} -->
|
11
|
-
<ul class=\\"has-large-font-size\\"><li>Line 1 to be made large</li><li>Line 2 to be made large</li><li>Line 3 to be made large</li></ul>
|
12
|
-
<!-- /wp:list -->"
|
13
|
-
`;
|
14
|
-
|
15
9
|
exports[`Keep styles on block transforms Should keep the font size during a transform from multiple blocks into multiple blocks 1`] = `
|
16
10
|
"<!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
|
17
11
|
<h2 class=\\"has-large-font-size\\">Line 1 to be made large</h2>
|
@@ -152,7 +152,9 @@ exports[`Multi-block selection should multi-select from within the list block 1`
|
|
152
152
|
<!-- /wp:paragraph -->
|
153
153
|
|
154
154
|
<!-- wp:list -->
|
155
|
-
<ul
|
155
|
+
<ul><!-- wp:list-item -->
|
156
|
+
<li>1</li>
|
157
|
+
<!-- /wp:list-item --></ul>
|
156
158
|
<!-- /wp:list -->"
|
157
159
|
`;
|
158
160
|
|
@@ -248,6 +250,28 @@ exports[`Multi-block selection should preserve dragged selection on move 1`] = `
|
|
248
250
|
<!-- /wp:paragraph -->"
|
249
251
|
`;
|
250
252
|
|
253
|
+
exports[`Multi-block selection should properly select multiple blocks if selected nested blocks belong to different parent 1`] = `
|
254
|
+
"<!-- wp:group {\\"layout\\":{\\"type\\":\\"constrained\\"}} -->
|
255
|
+
<div class=\\"wp-block-group\\"><!-- wp:paragraph -->
|
256
|
+
<p>first</p>
|
257
|
+
<!-- /wp:paragraph -->
|
258
|
+
|
259
|
+
<!-- wp:paragraph -->
|
260
|
+
<p>group</p>
|
261
|
+
<!-- /wp:paragraph --></div>
|
262
|
+
<!-- /wp:group -->
|
263
|
+
|
264
|
+
<!-- wp:group {\\"layout\\":{\\"type\\":\\"constrained\\"}} -->
|
265
|
+
<div class=\\"wp-block-group\\"><!-- wp:paragraph -->
|
266
|
+
<p>second</p>
|
267
|
+
<!-- /wp:paragraph -->
|
268
|
+
|
269
|
+
<!-- wp:paragraph -->
|
270
|
+
<p>group</p>
|
271
|
+
<!-- /wp:paragraph --></div>
|
272
|
+
<!-- /wp:group -->"
|
273
|
+
`;
|
274
|
+
|
251
275
|
exports[`Multi-block selection should return original focus after failed multi selection attempt 1`] = `
|
252
276
|
"<!-- wp:paragraph -->
|
253
277
|
<p>2</p>
|
@@ -102,12 +102,24 @@ exports[`RichText should only mutate text data on input 1`] = `
|
|
102
102
|
|
103
103
|
exports[`RichText should paste list contents into paragraph 1`] = `
|
104
104
|
"<!-- wp:list -->
|
105
|
-
<ul
|
105
|
+
<ul><!-- wp:list-item -->
|
106
|
+
<li>1<!-- wp:list -->
|
107
|
+
<ul><!-- wp:list-item -->
|
108
|
+
<li>2</li>
|
109
|
+
<!-- /wp:list-item --></ul>
|
110
|
+
<!-- /wp:list --></li>
|
111
|
+
<!-- /wp:list-item --></ul>
|
106
112
|
<!-- /wp:list -->
|
107
113
|
|
108
|
-
<!-- wp:
|
109
|
-
<
|
110
|
-
<!--
|
114
|
+
<!-- wp:list -->
|
115
|
+
<ul><!-- wp:list-item -->
|
116
|
+
<li>1<!-- wp:list -->
|
117
|
+
<ul><!-- wp:list-item -->
|
118
|
+
<li>2</li>
|
119
|
+
<!-- /wp:list-item --></ul>
|
120
|
+
<!-- /wp:list --></li>
|
121
|
+
<!-- /wp:list-item --></ul>
|
122
|
+
<!-- /wp:list -->"
|
111
123
|
`;
|
112
124
|
|
113
125
|
exports[`RichText should paste paragraph contents into list 1`] = `
|
@@ -116,7 +128,9 @@ exports[`RichText should paste paragraph contents into list 1`] = `
|
|
116
128
|
<!-- /wp:paragraph -->
|
117
129
|
|
118
130
|
<!-- wp:list -->
|
119
|
-
<ul
|
131
|
+
<ul><!-- wp:list-item -->
|
132
|
+
<li>1<br>2</li>
|
133
|
+
<!-- /wp:list-item --></ul>
|
120
134
|
<!-- /wp:list -->"
|
121
135
|
`;
|
122
136
|
|
@@ -24,16 +24,6 @@ exports[`Writing Flow Should navigate inner blocks with arrow keys 1`] = `
|
|
24
24
|
<!-- /wp:paragraph -->"
|
25
25
|
`;
|
26
26
|
|
27
|
-
exports[`Writing Flow should allow selecting entire list with longer last item 1`] = `
|
28
|
-
"<!-- wp:paragraph -->
|
29
|
-
<p>a</p>
|
30
|
-
<!-- /wp:paragraph -->
|
31
|
-
|
32
|
-
<!-- wp:list -->
|
33
|
-
<ul><li></li></ul>
|
34
|
-
<!-- /wp:list -->"
|
35
|
-
`;
|
36
|
-
|
37
27
|
exports[`Writing Flow should create valid paragraph blocks when rapidly pressing Enter 1`] = `
|
38
28
|
"<!-- wp:paragraph -->
|
39
29
|
<p></p>
|
@@ -208,7 +198,9 @@ exports[`Writing Flow should navigate empty paragraphs 1`] = `
|
|
208
198
|
|
209
199
|
exports[`Writing Flow should not create extra line breaks in multiline value 1`] = `
|
210
200
|
"<!-- wp:list -->
|
211
|
-
<ul
|
201
|
+
<ul><!-- wp:list-item -->
|
202
|
+
<li></li>
|
203
|
+
<!-- /wp:list-item --></ul>
|
212
204
|
<!-- /wp:list -->"
|
213
205
|
`;
|
214
206
|
|
@@ -18,6 +18,8 @@ describe( 'Block Switcher', () => {
|
|
18
18
|
// Insert a list block.
|
19
19
|
await insertBlock( 'List' );
|
20
20
|
await page.keyboard.type( 'List content' );
|
21
|
+
await page.keyboard.press( 'ArrowUp' );
|
22
|
+
await page.keyboard.press( 'ArrowUp' );
|
21
23
|
await pressKeyWithModifier( 'alt', 'F10' );
|
22
24
|
|
23
25
|
// Verify the block switcher exists.
|
@@ -31,7 +33,6 @@ describe( 'Block Switcher', () => {
|
|
31
33
|
'Heading',
|
32
34
|
'Quote',
|
33
35
|
'Columns',
|
34
|
-
'Table of Contents',
|
35
36
|
] )
|
36
37
|
);
|
37
38
|
} );
|
@@ -45,6 +46,8 @@ describe( 'Block Switcher', () => {
|
|
45
46
|
// Insert a list block.
|
46
47
|
await insertBlock( 'List' );
|
47
48
|
await page.keyboard.type( 'List content' );
|
49
|
+
await page.keyboard.press( 'ArrowUp' );
|
50
|
+
await page.keyboard.press( 'ArrowUp' );
|
48
51
|
await pressKeyWithModifier( 'alt', 'F10' );
|
49
52
|
|
50
53
|
// Verify the block switcher exists.
|
@@ -56,7 +59,7 @@ describe( 'Block Switcher', () => {
|
|
56
59
|
'Group',
|
57
60
|
'Paragraph',
|
58
61
|
'Heading',
|
59
|
-
'
|
62
|
+
'Columns',
|
60
63
|
] )
|
61
64
|
);
|
62
65
|
} );
|
@@ -71,13 +74,14 @@ describe( 'Block Switcher', () => {
|
|
71
74
|
'core/group',
|
72
75
|
'core/heading',
|
73
76
|
'core/columns',
|
74
|
-
'core/table-of-contents',
|
75
77
|
].map( ( block ) => wp.blocks.unregisterBlockType( block ) );
|
76
78
|
} );
|
77
79
|
|
78
80
|
// Insert a list block.
|
79
81
|
await insertBlock( 'List' );
|
80
82
|
await page.keyboard.type( 'List content' );
|
83
|
+
await page.keyboard.press( 'ArrowUp' );
|
84
|
+
await page.keyboard.press( 'ArrowUp' );
|
81
85
|
await pressKeyWithModifier( 'alt', 'F10' );
|
82
86
|
|
83
87
|
// Verify the block switcher exists.
|
@@ -91,6 +95,8 @@ describe( 'Block Switcher', () => {
|
|
91
95
|
it( 'Should show Columns block only if selected blocks are between limits (1-6)', async () => {
|
92
96
|
await insertBlock( 'List' );
|
93
97
|
await page.keyboard.type( 'List content' );
|
98
|
+
await page.keyboard.press( 'ArrowUp' );
|
99
|
+
await page.keyboard.press( 'ArrowUp' );
|
94
100
|
await insertBlock( 'Heading' );
|
95
101
|
await page.keyboard.type( 'I am a header' );
|
96
102
|
await page.keyboard.down( 'Shift' );
|
@@ -103,6 +109,8 @@ describe( 'Block Switcher', () => {
|
|
103
109
|
it( 'Should NOT show Columns transform only if selected blocks are more than max limit(6)', async () => {
|
104
110
|
await insertBlock( 'List' );
|
105
111
|
await page.keyboard.type( 'List content' );
|
112
|
+
await page.keyboard.press( 'ArrowUp' );
|
113
|
+
await page.keyboard.press( 'ArrowUp' );
|
106
114
|
await insertBlock( 'Heading' );
|
107
115
|
await page.keyboard.type( 'I am a header' );
|
108
116
|
await page.keyboard.press( 'Enter' );
|
@@ -279,6 +279,8 @@ describe( 'Inserting blocks', () => {
|
|
279
279
|
await insertBlock( 'Group' );
|
280
280
|
await insertBlock( 'Paragraph' );
|
281
281
|
await page.keyboard.type( 'Paragraph after group' );
|
282
|
+
// Click the Group first to make the appender inside it clickable.
|
283
|
+
await page.click( '[data-type="core/group"]' );
|
282
284
|
await page.click( '[data-type="core/group"] [aria-label="Add block"]' );
|
283
285
|
const browseAll = await page.waitForXPath(
|
284
286
|
'//button[text()="Browse all"]'
|
@@ -295,6 +297,8 @@ describe( 'Inserting blocks', () => {
|
|
295
297
|
await insertBlock( 'Group' );
|
296
298
|
await insertBlock( 'Paragraph' );
|
297
299
|
await page.keyboard.type( 'Text' );
|
300
|
+
// Click the Group first to make the appender inside it clickable.
|
301
|
+
await page.click( '[data-type="core/group"]' );
|
298
302
|
await page.click( '[data-type="core/group"] [aria-label="Add block"]' );
|
299
303
|
await page.waitForSelector( INSERTER_SEARCH_SELECTOR );
|
300
304
|
await page.focus( INSERTER_SEARCH_SELECTOR );
|
@@ -34,23 +34,6 @@ describe( 'Keep styles on block transforms', () => {
|
|
34
34
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
35
35
|
} );
|
36
36
|
|
37
|
-
it( 'Should keep the font size during a transform from multiple blocks into a single one', async () => {
|
38
|
-
// Create a paragraph block with some content.
|
39
|
-
await clickBlockAppender();
|
40
|
-
await page.keyboard.type( 'Line 1 to be made large' );
|
41
|
-
await page.keyboard.press( 'Enter' );
|
42
|
-
await page.keyboard.type( 'Line 2 to be made large' );
|
43
|
-
await page.keyboard.press( 'Enter' );
|
44
|
-
await page.keyboard.type( 'Line 3 to be made large' );
|
45
|
-
await pressKeyWithModifier( 'shift', 'ArrowUp' );
|
46
|
-
await pressKeyWithModifier( 'shift', 'ArrowUp' );
|
47
|
-
await page.click(
|
48
|
-
'[role="radiogroup"][aria-label="Font size"] [aria-label="Large"]'
|
49
|
-
);
|
50
|
-
await transformBlockTo( 'List' );
|
51
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
52
|
-
} );
|
53
|
-
|
54
37
|
it( 'Should keep the font size during a transform from multiple blocks into multiple blocks', async () => {
|
55
38
|
// Create a paragraph block with some content.
|
56
39
|
await clickBlockAppender();
|
@@ -331,6 +331,9 @@ describe( 'Multi-block selection', () => {
|
|
331
331
|
await page.keyboard.up( 'Shift' );
|
332
332
|
await transformBlockTo( 'Group' );
|
333
333
|
|
334
|
+
// Confirm setup.
|
335
|
+
expect( await getEditedPostContent() ).toMatchSnapshot();
|
336
|
+
|
334
337
|
// Click the first paragraph in the first Group block while pressing `shift` key.
|
335
338
|
const firstParagraph = await page.waitForXPath( "//p[text()='first']" );
|
336
339
|
await page.keyboard.down( 'Shift' );
|
@@ -676,6 +679,10 @@ describe( 'Multi-block selection', () => {
|
|
676
679
|
|
677
680
|
await pressKeyWithModifier( 'primary', 'a' );
|
678
681
|
|
682
|
+
await page.waitForSelector( '[data-type="core/column"].is-selected' );
|
683
|
+
|
684
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
685
|
+
|
679
686
|
await page.waitForSelector(
|
680
687
|
'[data-type="core/column"].is-multi-selected'
|
681
688
|
);
|
@@ -699,6 +706,7 @@ describe( 'Multi-block selection', () => {
|
|
699
706
|
// Confirm correct setup: a paragraph and a list.
|
700
707
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
701
708
|
|
709
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
702
710
|
await pressKeyWithModifier( 'primary', 'a' );
|
703
711
|
await pressKeyWithModifier( 'primary', 'a' );
|
704
712
|
|
@@ -473,15 +473,18 @@ describe( 'RichText', () => {
|
|
473
473
|
await page.keyboard.press( 'Enter' );
|
474
474
|
await page.keyboard.type( ' 2' );
|
475
475
|
|
476
|
-
// Select all
|
476
|
+
// Select all text.
|
477
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
478
|
+
// Select the nested list.
|
479
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
480
|
+
// Select the parent list item.
|
481
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
482
|
+
// Select all the parent list item text.
|
483
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
484
|
+
// Select the entire list.
|
477
485
|
await pressKeyWithModifier( 'primary', 'a' );
|
478
486
|
await pressKeyWithModifier( 'primary', 'c' );
|
479
487
|
|
480
|
-
// Collapse the selection to the end.
|
481
|
-
await page.keyboard.press( 'ArrowRight' );
|
482
|
-
|
483
|
-
// Create a paragraph.
|
484
|
-
await page.keyboard.press( 'Enter' );
|
485
488
|
await page.keyboard.press( 'Enter' );
|
486
489
|
|
487
490
|
// Paste paragraph contents.
|
@@ -235,7 +235,7 @@ describe( 'splitting and merging blocks', () => {
|
|
235
235
|
await page.keyboard.type( 'item 1' );
|
236
236
|
await page.keyboard.press( 'Enter' );
|
237
237
|
await page.keyboard.type( 'item 2' );
|
238
|
-
await pressKeyTimes( 'ArrowUp',
|
238
|
+
await pressKeyTimes( 'ArrowUp', 5 );
|
239
239
|
await page.keyboard.press( 'Delete' );
|
240
240
|
// Carret should be in the first block and at the proper position.
|
241
241
|
await page.keyboard.type( '-' );
|
@@ -257,13 +257,18 @@ describe( 'splitting and merging blocks', () => {
|
|
257
257
|
await page.keyboard.press( 'Enter' );
|
258
258
|
await page.keyboard.type( 'item 2' );
|
259
259
|
await page.keyboard.press( 'ArrowUp' );
|
260
|
+
await page.keyboard.press( 'ArrowUp' );
|
260
261
|
await pressKeyTimes( 'ArrowLeft', 6 );
|
261
262
|
await page.keyboard.press( 'Backspace' );
|
262
263
|
// Carret should be in the first block and at the proper position.
|
263
264
|
await page.keyboard.type( '-' );
|
264
265
|
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
265
266
|
"<!-- wp:paragraph -->
|
266
|
-
<p>hi
|
267
|
+
<p>hi</p>
|
268
|
+
<!-- /wp:paragraph -->
|
269
|
+
|
270
|
+
<!-- wp:paragraph -->
|
271
|
+
<p>-item 1</p>
|
267
272
|
<!-- /wp:paragraph -->
|
268
273
|
|
269
274
|
<!-- wp:paragraph -->
|
@@ -86,7 +86,8 @@ describe( 'Toolbar roving tabindex', () => {
|
|
86
86
|
it( 'ensures list block toolbar uses roving tabindex', async () => {
|
87
87
|
await insertBlock( 'List' );
|
88
88
|
await page.keyboard.type( 'List' );
|
89
|
-
await testBlockToolbarKeyboardNavigation( '
|
89
|
+
await testBlockToolbarKeyboardNavigation( 'List text', 'Select List' );
|
90
|
+
await page.click( `[aria-label="Select List"]` );
|
90
91
|
await wrapCurrentBlockWithGroup( 'List' );
|
91
92
|
await testGroupKeyboardNavigation( 'Block: List', 'List' );
|
92
93
|
} );
|
@@ -570,21 +570,25 @@ describe( 'Writing Flow', () => {
|
|
570
570
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
571
571
|
} );
|
572
572
|
|
573
|
-
it( 'should
|
573
|
+
it( 'should extend selection into paragraph for list with longer last item', async () => {
|
574
574
|
await page.keyboard.press( 'Enter' );
|
575
575
|
await page.keyboard.type( 'a' );
|
576
576
|
await page.keyboard.press( 'Enter' );
|
577
577
|
await page.keyboard.type( '* b' );
|
578
578
|
await page.keyboard.press( 'Enter' );
|
579
579
|
await page.keyboard.type( 'cd' );
|
580
|
+
|
581
|
+
// Selects part of the first list item, although invisible.
|
580
582
|
await pressKeyWithModifier( 'shift', 'ArrowUp' );
|
583
|
+
await page.evaluate( () => new Promise( window.requestIdleCallback ) );
|
584
|
+
// Extends selection into the first paragraph
|
581
585
|
await pressKeyWithModifier( 'shift', 'ArrowUp' );
|
586
|
+
await page.evaluate( () => new Promise( window.requestIdleCallback ) );
|
582
587
|
|
583
|
-
//
|
584
|
-
// the list.
|
588
|
+
// Mixed selection, so all content will be removed.
|
585
589
|
await page.keyboard.press( 'Backspace' );
|
586
590
|
|
587
|
-
expect( await getEditedPostContent() ).
|
591
|
+
expect( await getEditedPostContent() ).toBe( '' );
|
588
592
|
} );
|
589
593
|
|
590
594
|
it( 'should not have a dead zone between blocks (lower)', async () => {
|
@@ -1,32 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
activatePlugin,
|
6
|
-
createNewPost,
|
7
|
-
deactivatePlugin,
|
8
|
-
openGlobalBlockInserter,
|
9
|
-
} from '@wordpress/e2e-test-utils';
|
10
|
-
|
11
|
-
describe( 'Register block type hooks', () => {
|
12
|
-
beforeEach( async () => {
|
13
|
-
await activatePlugin( 'gutenberg-test-register-block-type-hooks' );
|
14
|
-
await createNewPost();
|
15
|
-
} );
|
16
|
-
|
17
|
-
afterEach( async () => {
|
18
|
-
await deactivatePlugin( 'gutenberg-test-register-block-type-hooks' );
|
19
|
-
} );
|
20
|
-
|
21
|
-
it( 'has a custom category for Paragraph block', async () => {
|
22
|
-
await openGlobalBlockInserter();
|
23
|
-
|
24
|
-
const widgetsCategory = await page.waitForSelector(
|
25
|
-
'.block-editor-block-types-list[aria-label="Widgets"]'
|
26
|
-
);
|
27
|
-
|
28
|
-
expect(
|
29
|
-
await widgetsCategory.$( '.editor-block-list-item-paragraph' )
|
30
|
-
).toBeDefined();
|
31
|
-
} );
|
32
|
-
} );
|
@@ -1,21 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Duplicating blocks should duplicate blocks using the block settings menu 1`] = `
|
4
|
-
"<!-- wp:paragraph -->
|
5
|
-
<p>Clone me</p>
|
6
|
-
<!-- /wp:paragraph -->
|
7
|
-
|
8
|
-
<!-- wp:paragraph -->
|
9
|
-
<p>Clone me</p>
|
10
|
-
<!-- /wp:paragraph -->"
|
11
|
-
`;
|
12
|
-
|
13
|
-
exports[`Duplicating blocks should duplicate blocks using the keyboard shortcut 1`] = `
|
14
|
-
"<!-- wp:paragraph -->
|
15
|
-
<p>Clone me</p>
|
16
|
-
<!-- /wp:paragraph -->
|
17
|
-
|
18
|
-
<!-- wp:paragraph -->
|
19
|
-
<p>Clone me</p>
|
20
|
-
<!-- /wp:paragraph -->"
|
21
|
-
`;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
clickMenuItem,
|
6
|
-
createNewPost,
|
7
|
-
insertBlock,
|
8
|
-
getEditedPostContent,
|
9
|
-
clickBlockToolbarButton,
|
10
|
-
pressKeyWithModifier,
|
11
|
-
} from '@wordpress/e2e-test-utils';
|
12
|
-
|
13
|
-
describe( 'Duplicating blocks', () => {
|
14
|
-
beforeEach( async () => {
|
15
|
-
await createNewPost();
|
16
|
-
} );
|
17
|
-
|
18
|
-
it( 'should duplicate blocks using the block settings menu', async () => {
|
19
|
-
await insertBlock( 'Paragraph' );
|
20
|
-
await page.keyboard.type( 'Clone me' );
|
21
|
-
|
22
|
-
// Select the test we just typed
|
23
|
-
// This doesn't do anything but we previously had a duplicationi bug
|
24
|
-
// When the selection was not collapsed.
|
25
|
-
await pressKeyWithModifier( 'primary', 'a' );
|
26
|
-
|
27
|
-
await clickBlockToolbarButton( 'Options' );
|
28
|
-
await clickMenuItem( 'Duplicate' );
|
29
|
-
|
30
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
31
|
-
} );
|
32
|
-
|
33
|
-
it( 'should duplicate blocks using the keyboard shortcut', async () => {
|
34
|
-
await insertBlock( 'Paragraph' );
|
35
|
-
await page.keyboard.type( 'Clone me' );
|
36
|
-
|
37
|
-
// Select the test we just typed
|
38
|
-
// This doesn't do anything but we previously had a duplicationi bug
|
39
|
-
// When the selection was not collapsed.
|
40
|
-
await pressKeyWithModifier( 'primary', 'a' );
|
41
|
-
|
42
|
-
// Duplicate using the keyboard shortccut.
|
43
|
-
await pressKeyWithModifier( 'primaryShift', 'd' );
|
44
|
-
|
45
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
46
|
-
} );
|
47
|
-
} );
|