@wordpress/e2e-tests 5.6.0 → 6.1.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/CHANGELOG.md +8 -0
- package/assets/small-post-with-containers.html +77 -0
- package/config/performance-reporter.js +22 -6
- package/config/setup-performance-test.js +3 -0
- package/package.json +9 -9
- package/plugins/inner-blocks-templates/index.js +29 -0
- package/specs/editor/blocks/__snapshots__/heading.test.js.snap +7 -7
- package/specs/editor/blocks/heading.test.js +1 -1
- package/specs/editor/plugins/block-directory-add.test.js +1 -1
- package/specs/editor/various/__snapshots__/block-grouping.test.js.snap +4 -4
- package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +2 -2
- package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +3 -3
- package/specs/editor/various/__snapshots__/list-view.test.js.snap +1 -1
- package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +4 -4
- package/specs/editor/various/__snapshots__/rich-text.test.js.snap +1 -1
- package/specs/editor/various/a11y.test.js +3 -1
- package/specs/editor/various/block-hierarchy-navigation.test.js +2 -4
- package/specs/editor/various/block-switcher.test.js +14 -13
- package/specs/editor/various/editor-modes.test.js +3 -7
- package/specs/editor/various/keyboard-navigable-blocks.test.js +7 -0
- package/specs/editor/various/multi-block-selection.test.js +1 -1
- package/specs/editor/various/reusable-blocks.test.js +2 -2
- package/specs/editor/various/sidebar.test.js +0 -2
- package/specs/experiments/blocks/post-comments-form.test.js +7 -8
- package/specs/performance/post-editor.test.js +98 -44
- package/specs/performance/site-editor.test.js +3 -0
- package/specs/site-editor/global-styles-sidebar.test.js +2 -0
- package/specs/site-editor/multi-entity-saving.test.js +18 -12
- package/specs/site-editor/settings-sidebar.test.js +3 -0
- package/specs/site-editor/site-editor-export.test.js +2 -0
- package/specs/editor/blocks/__snapshots__/quote.test.js.snap +0 -123
- package/specs/editor/blocks/quote.test.js +0 -199
- package/specs/editor/various/font-size-picker.test.js +0 -314
- package/specs/editor/various/toolbar-roving-tabindex.test.js +0 -142
- package/specs/site-editor/multi-entity-editing.test.js +0 -309
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 6.1.0 (2023-01-02)
|
6
|
+
|
7
|
+
## 6.0.0 (2022-12-14)
|
8
|
+
|
9
|
+
### Breaking Changes
|
10
|
+
|
11
|
+
- Updated dependencies to require React 18 ([45235](https://github.com/WordPress/gutenberg/pull/45235))
|
12
|
+
|
5
13
|
## 5.6.0 (2022-11-16)
|
6
14
|
|
7
15
|
## 5.5.0 (2022-11-02)
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<!-- wp:columns {"align":"full"} -->
|
2
|
+
<div class="wp-block-columns alignfull"><!-- wp:column -->
|
3
|
+
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
|
4
|
+
<h3 class="wp-block-heading">Heading</h3>
|
5
|
+
<!-- /wp:heading -->
|
6
|
+
|
7
|
+
<!-- wp:paragraph -->
|
8
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
9
|
+
<!-- /wp:paragraph -->
|
10
|
+
|
11
|
+
<!-- wp:list -->
|
12
|
+
<ul><!-- wp:list-item -->
|
13
|
+
<li>one</li>
|
14
|
+
<!-- /wp:list-item -->
|
15
|
+
|
16
|
+
<!-- wp:list-item -->
|
17
|
+
<li>two</li>
|
18
|
+
<!-- /wp:list-item -->
|
19
|
+
|
20
|
+
<!-- wp:list-item -->
|
21
|
+
<li>three</li>
|
22
|
+
<!-- /wp:list-item --></ul>
|
23
|
+
<!-- /wp:list --></div>
|
24
|
+
<!-- /wp:column -->
|
25
|
+
|
26
|
+
<!-- wp:column -->
|
27
|
+
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
|
28
|
+
<h3 class="wp-block-heading">Heading</h3>
|
29
|
+
<!-- /wp:heading -->
|
30
|
+
|
31
|
+
<!-- wp:paragraph -->
|
32
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
33
|
+
<!-- /wp:paragraph -->
|
34
|
+
|
35
|
+
<!-- wp:list -->
|
36
|
+
<ul><!-- wp:list-item -->
|
37
|
+
<li>one</li>
|
38
|
+
<!-- /wp:list-item -->
|
39
|
+
|
40
|
+
<!-- wp:list-item -->
|
41
|
+
<li>two</li>
|
42
|
+
<!-- /wp:list-item -->
|
43
|
+
|
44
|
+
<!-- wp:list-item -->
|
45
|
+
<li>three</li>
|
46
|
+
<!-- /wp:list-item --></ul>
|
47
|
+
<!-- /wp:list --></div>
|
48
|
+
<!-- /wp:column -->
|
49
|
+
|
50
|
+
<!-- wp:column -->
|
51
|
+
<div class="wp-block-column"><!-- wp:heading {"level":3} -->
|
52
|
+
<h3 class="wp-block-heading">Heading</h3>
|
53
|
+
<!-- /wp:heading -->
|
54
|
+
|
55
|
+
<!-- wp:paragraph -->
|
56
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
57
|
+
<!-- /wp:paragraph -->
|
58
|
+
|
59
|
+
<!-- wp:list -->
|
60
|
+
<ul><!-- wp:list-item -->
|
61
|
+
<li>one</li>
|
62
|
+
<!-- /wp:list-item -->
|
63
|
+
|
64
|
+
<!-- wp:list-item -->
|
65
|
+
<li>two</li>
|
66
|
+
<!-- /wp:list-item -->
|
67
|
+
|
68
|
+
<!-- wp:list-item -->
|
69
|
+
<li>three</li>
|
70
|
+
<!-- /wp:list-item --></ul>
|
71
|
+
<!-- /wp:list --></div>
|
72
|
+
<!-- /wp:column --></div>
|
73
|
+
<!-- /wp:columns -->
|
74
|
+
|
75
|
+
<!-- wp:paragraph -->
|
76
|
+
<p></p>
|
77
|
+
<!-- /wp:paragraph -->
|
@@ -36,6 +36,7 @@ class PerformanceReporter {
|
|
36
36
|
firstContentfulPaint,
|
37
37
|
firstBlock,
|
38
38
|
type,
|
39
|
+
typeContainer,
|
39
40
|
focus,
|
40
41
|
listViewOpen,
|
41
42
|
inserterOpen,
|
@@ -68,7 +69,7 @@ Average time to first block: ${ success(
|
|
68
69
|
if ( type && type.length ) {
|
69
70
|
// eslint-disable-next-line no-console
|
70
71
|
console.log( `
|
71
|
-
${ title( 'Typing
|
72
|
+
${ title( 'Typing:' ) }
|
72
73
|
Average time to type character: ${ success( round( average( type ) ) + 'ms' ) }
|
73
74
|
Slowest time to type character: ${ success(
|
74
75
|
round( Math.max( ...type ) ) + 'ms'
|
@@ -78,10 +79,25 @@ Fastest time to type character: ${ success(
|
|
78
79
|
) }` );
|
79
80
|
}
|
80
81
|
|
82
|
+
if ( typeContainer && typeContainer.length ) {
|
83
|
+
// eslint-disable-next-line no-console
|
84
|
+
console.log( `
|
85
|
+
${ title( 'Typing within a container:' ) }
|
86
|
+
Average time to type within a container: ${ success(
|
87
|
+
round( average( typeContainer ) ) + 'ms'
|
88
|
+
) }
|
89
|
+
Slowest time to type within a container: ${ success(
|
90
|
+
round( Math.max( ...typeContainer ) ) + 'ms'
|
91
|
+
) }
|
92
|
+
Fastest time to type within a container: ${ success(
|
93
|
+
round( Math.min( ...typeContainer ) ) + 'ms'
|
94
|
+
) }` );
|
95
|
+
}
|
96
|
+
|
81
97
|
if ( focus && focus.length ) {
|
82
98
|
// eslint-disable-next-line no-console
|
83
99
|
console.log( `
|
84
|
-
${ title( 'Block Selection
|
100
|
+
${ title( 'Block Selection:' ) }
|
85
101
|
Average time to select a block: ${ success( round( average( focus ) ) + 'ms' ) }
|
86
102
|
Slowest time to select a block: ${ success(
|
87
103
|
round( Math.max( ...focus ) ) + 'ms'
|
@@ -94,7 +110,7 @@ Fastest time to select a block: ${ success(
|
|
94
110
|
if ( listViewOpen && listViewOpen.length ) {
|
95
111
|
// eslint-disable-next-line no-console
|
96
112
|
console.log( `
|
97
|
-
${ title( 'Opening List View
|
113
|
+
${ title( 'Opening List View:' ) }
|
98
114
|
Average time to open list view: ${ success(
|
99
115
|
round( average( listViewOpen ) ) + 'ms'
|
100
116
|
) }
|
@@ -109,7 +125,7 @@ Fastest time to open list view: ${ success(
|
|
109
125
|
if ( inserterOpen && inserterOpen.length ) {
|
110
126
|
// eslint-disable-next-line no-console
|
111
127
|
console.log( `
|
112
|
-
${ title( 'Opening Global Inserter
|
128
|
+
${ title( 'Opening Global Inserter:' ) }
|
113
129
|
Average time to open global inserter: ${ success(
|
114
130
|
round( average( inserterOpen ) ) + 'ms'
|
115
131
|
) }
|
@@ -124,7 +140,7 @@ Fastest time to open global inserter: ${ success(
|
|
124
140
|
if ( inserterSearch && inserterSearch.length ) {
|
125
141
|
// eslint-disable-next-line no-console
|
126
142
|
console.log( `
|
127
|
-
${ title( 'Inserter Search
|
143
|
+
${ title( 'Inserter Search:' ) }
|
128
144
|
Average time to type the inserter search input: ${ success(
|
129
145
|
round( average( inserterSearch ) ) + 'ms'
|
130
146
|
) }
|
@@ -139,7 +155,7 @@ Fastest time to type the inserter search input: ${ success(
|
|
139
155
|
if ( inserterHover && inserterHover.length ) {
|
140
156
|
// eslint-disable-next-line no-console
|
141
157
|
console.log( `
|
142
|
-
${ title( 'Inserter Block Item Hover
|
158
|
+
${ title( 'Inserter Block Item Hover:' ) }
|
143
159
|
Average time to move mouse between two block item in the inserter: ${ success(
|
144
160
|
round( average( inserterHover ) ) + 'ms'
|
145
161
|
) }
|
@@ -34,6 +34,9 @@ beforeAll( async () => {
|
|
34
34
|
await trashAllPosts( 'wp_block' );
|
35
35
|
await setupBrowser();
|
36
36
|
await activatePlugin( 'gutenberg-test-plugin-disables-the-css-animations' );
|
37
|
+
await page.emulateMediaFeatures( [
|
38
|
+
{ name: 'prefers-reduced-motion', value: 'reduce' },
|
39
|
+
] );
|
37
40
|
} );
|
38
41
|
|
39
42
|
afterEach( async () => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "
|
3
|
+
"version": "6.1.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": "^
|
27
|
-
"@wordpress/jest-console": "^6.
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^5.
|
29
|
-
"@wordpress/scripts": "^
|
30
|
-
"@wordpress/url": "^3.
|
26
|
+
"@wordpress/e2e-test-utils": "^9.1.0",
|
27
|
+
"@wordpress/jest-console": "^6.7.0",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^5.7.0",
|
29
|
+
"@wordpress/scripts": "^25.1.0",
|
30
|
+
"@wordpress/url": "^3.25.0",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
@@ -40,11 +40,11 @@
|
|
40
40
|
"peerDependencies": {
|
41
41
|
"jest": ">=27",
|
42
42
|
"puppeteer-core": ">=11",
|
43
|
-
"react": "^
|
44
|
-
"react-dom": "^
|
43
|
+
"react": "^18.0.0",
|
44
|
+
"react-dom": "^18.0.0"
|
45
45
|
},
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "200bee7b06b15f6fa655e25b6ab69cbd6b49a357"
|
50
50
|
}
|
@@ -3,6 +3,8 @@
|
|
3
3
|
const createBlock = wp.blocks.createBlock;
|
4
4
|
const el = wp.element.createElement;
|
5
5
|
const InnerBlocks = wp.blockEditor.InnerBlocks;
|
6
|
+
const useState = window.wp.element.useState;
|
7
|
+
|
6
8
|
const TEMPLATE = [
|
7
9
|
[
|
8
10
|
'core/paragraph',
|
@@ -171,4 +173,31 @@
|
|
171
173
|
|
172
174
|
save,
|
173
175
|
} );
|
176
|
+
|
177
|
+
|
178
|
+
function InnerBlocksAsyncTemplateEdit() {
|
179
|
+
const [ template, setTemplate ] = useState( [] );
|
180
|
+
|
181
|
+
setInterval( () => {
|
182
|
+
setTemplate( TEMPLATE_TWO_PARAGRAPHS );
|
183
|
+
}, 1000 );
|
184
|
+
|
185
|
+
return el( InnerBlocks, {
|
186
|
+
template,
|
187
|
+
} );
|
188
|
+
}
|
189
|
+
|
190
|
+
registerBlockType(
|
191
|
+
'test/test-inner-blocks-async-template',
|
192
|
+
{
|
193
|
+
title: 'Test Inner Blocks Async Template',
|
194
|
+
icon: 'cart',
|
195
|
+
category: 'text',
|
196
|
+
|
197
|
+
edit: InnerBlocksAsyncTemplateEdit,
|
198
|
+
|
199
|
+
// Purposely do not save inner blocks so that it's possible to test template resolution.
|
200
|
+
save() {},
|
201
|
+
}
|
202
|
+
);
|
174
203
|
} )();
|
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
exports[`Heading can be created by prefixing existing content with number signs and a space 1`] = `
|
4
4
|
"<!-- wp:heading {\\"level\\":4} -->
|
5
|
-
<h4>4</h4>
|
5
|
+
<h4 class=\\"wp-block-heading\\">4</h4>
|
6
6
|
<!-- /wp:heading -->"
|
7
7
|
`;
|
8
8
|
|
9
9
|
exports[`Heading can be created by prefixing number sign and a space 1`] = `
|
10
10
|
"<!-- wp:heading {\\"level\\":3} -->
|
11
|
-
<h3>3</h3>
|
11
|
+
<h3 class=\\"wp-block-heading\\">3</h3>
|
12
12
|
<!-- /wp:heading -->"
|
13
13
|
`;
|
14
14
|
|
15
15
|
exports[`Heading should correctly apply named colors 1`] = `
|
16
16
|
"<!-- wp:heading {\\"textColor\\":\\"luminous-vivid-orange\\"} -->
|
17
|
-
<h2 class=\\"has-luminous-vivid-orange-color has-text-color\\">Heading</h2>
|
17
|
+
<h2 class=\\"wp-block-heading has-luminous-vivid-orange-color has-text-color\\">Heading</h2>
|
18
18
|
<!-- /wp:heading -->"
|
19
19
|
`;
|
20
20
|
|
@@ -24,13 +24,13 @@ exports[`Heading should create a paragraph block above when pressing enter at th
|
|
24
24
|
<!-- /wp:paragraph -->
|
25
25
|
|
26
26
|
<!-- wp:heading -->
|
27
|
-
<h2>a</h2>
|
27
|
+
<h2 class=\\"wp-block-heading\\">a</h2>
|
28
28
|
<!-- /wp:heading -->"
|
29
29
|
`;
|
30
30
|
|
31
31
|
exports[`Heading should create a paragraph block below when pressing enter at the end 1`] = `
|
32
32
|
"<!-- wp:heading -->
|
33
|
-
<h2>a</h2>
|
33
|
+
<h2 class=\\"wp-block-heading\\">a</h2>
|
34
34
|
<!-- /wp:heading -->
|
35
35
|
|
36
36
|
<!-- wp:paragraph -->
|
@@ -40,12 +40,12 @@ exports[`Heading should create a paragraph block below when pressing enter at th
|
|
40
40
|
|
41
41
|
exports[`Heading should not work with the list input rule 1`] = `
|
42
42
|
"<!-- wp:heading -->
|
43
|
-
<h2>1. H</h2>
|
43
|
+
<h2 class=\\"wp-block-heading\\">1. H</h2>
|
44
44
|
<!-- /wp:heading -->"
|
45
45
|
`;
|
46
46
|
|
47
47
|
exports[`Heading should work with the format input rules 1`] = `
|
48
48
|
"<!-- wp:heading -->
|
49
|
-
<h2><code>code</code></h2>
|
49
|
+
<h2 class=\\"wp-block-heading\\"><code>code</code></h2>
|
50
50
|
<!-- /wp:heading -->"
|
51
51
|
`;
|
@@ -87,7 +87,7 @@ describe( 'Heading', () => {
|
|
87
87
|
await page.keyboard.press( 'Enter' );
|
88
88
|
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
89
89
|
"<!-- wp:heading {\\"level\\":3,\\"style\\":{\\"color\\":{\\"text\\":\\"#4b7f4d\\"}}} -->
|
90
|
-
<h3 class=\\"has-text-color\\" style=\\"color:#4b7f4d\\">Heading</h3>
|
90
|
+
<h3 class=\\"wp-block-heading has-text-color\\" style=\\"color:#4b7f4d\\">Heading</h3>
|
91
91
|
<!-- /wp:heading -->"
|
92
92
|
` );
|
93
93
|
} );
|
@@ -3,7 +3,7 @@
|
|
3
3
|
exports[`Block Grouping Group creation creates a group from multiple blocks of different types via block transforms 1`] = `
|
4
4
|
"<!-- wp:group {\\"layout\\":{\\"type\\":\\"constrained\\"}} -->
|
5
5
|
<div class=\\"wp-block-group\\"><!-- wp:heading -->
|
6
|
-
<h2>Group Heading</h2>
|
6
|
+
<h2 class=\\"wp-block-heading\\">Group Heading</h2>
|
7
7
|
<!-- /wp:heading -->
|
8
8
|
|
9
9
|
<!-- wp:image -->
|
@@ -51,7 +51,7 @@ exports[`Block Grouping Group creation creates a group from multiple blocks of t
|
|
51
51
|
exports[`Block Grouping Group creation groups and ungroups multiple blocks of different types via options toolbar 1`] = `
|
52
52
|
"<!-- wp:group {\\"layout\\":{\\"type\\":\\"constrained\\"}} -->
|
53
53
|
<div class=\\"wp-block-group\\"><!-- wp:heading -->
|
54
|
-
<h2>Group Heading</h2>
|
54
|
+
<h2 class=\\"wp-block-heading\\">Group Heading</h2>
|
55
55
|
<!-- /wp:heading -->
|
56
56
|
|
57
57
|
<!-- wp:image -->
|
@@ -66,7 +66,7 @@ exports[`Block Grouping Group creation groups and ungroups multiple blocks of di
|
|
66
66
|
|
67
67
|
exports[`Block Grouping Group creation groups and ungroups multiple blocks of different types via options toolbar 2`] = `
|
68
68
|
"<!-- wp:heading -->
|
69
|
-
<h2>Group Heading</h2>
|
69
|
+
<h2 class=\\"wp-block-heading\\">Group Heading</h2>
|
70
70
|
<!-- /wp:heading -->
|
71
71
|
|
72
72
|
<!-- wp:image -->
|
@@ -81,7 +81,7 @@ exports[`Block Grouping Group creation groups and ungroups multiple blocks of di
|
|
81
81
|
exports[`Block Grouping Preserving selected blocks attributes preserves width alignment settings of selected blocks 1`] = `
|
82
82
|
"<!-- wp:group {\\"align\\":\\"full\\",\\"layout\\":{\\"type\\":\\"constrained\\"}} -->
|
83
83
|
<div class=\\"wp-block-group alignfull\\"><!-- wp:heading -->
|
84
|
-
<h2>Group Heading</h2>
|
84
|
+
<h2 class=\\"wp-block-heading\\">Group Heading</h2>
|
85
85
|
<!-- /wp:heading -->
|
86
86
|
|
87
87
|
<!-- wp:image {\\"align\\":\\"full\\"} -->
|
@@ -71,7 +71,7 @@ exports[`Inserting blocks inserts a block in proper place after having clicked \
|
|
71
71
|
<!-- /wp:paragraph -->
|
72
72
|
|
73
73
|
<!-- wp:heading -->
|
74
|
-
<h2>Heading</h2>
|
74
|
+
<h2 class=\\"wp-block-heading\\">Heading</h2>
|
75
75
|
<!-- /wp:heading -->
|
76
76
|
|
77
77
|
<!-- wp:paragraph -->
|
@@ -93,7 +93,7 @@ exports[`Inserting blocks inserts a block in proper place after having clicked \
|
|
93
93
|
<!-- /wp:cover -->
|
94
94
|
|
95
95
|
<!-- wp:heading -->
|
96
|
-
<h2>Heading</h2>
|
96
|
+
<h2 class=\\"wp-block-heading\\">Heading</h2>
|
97
97
|
<!-- /wp:heading -->
|
98
98
|
|
99
99
|
<!-- wp:paragraph -->
|
@@ -8,15 +8,15 @@ exports[`Keep styles on block transforms Should keep colors during a transform 1
|
|
8
8
|
|
9
9
|
exports[`Keep styles on block transforms Should keep the font size during a transform from multiple blocks into multiple blocks 1`] = `
|
10
10
|
"<!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
|
11
|
-
<h2 class=\\"has-large-font-size\\">Line 1 to be made large</h2>
|
11
|
+
<h2 class=\\"wp-block-heading has-large-font-size\\">Line 1 to be made large</h2>
|
12
12
|
<!-- /wp:heading -->
|
13
13
|
|
14
14
|
<!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
|
15
|
-
<h2 class=\\"has-large-font-size\\">Line 2 to be made large</h2>
|
15
|
+
<h2 class=\\"wp-block-heading has-large-font-size\\">Line 2 to be made large</h2>
|
16
16
|
<!-- /wp:heading -->
|
17
17
|
|
18
18
|
<!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
|
19
|
-
<h2 class=\\"has-large-font-size\\">Line 3 to be made large</h2>
|
19
|
+
<h2 class=\\"wp-block-heading has-large-font-size\\">Line 3 to be made large</h2>
|
20
20
|
<!-- /wp:heading -->"
|
21
21
|
`;
|
22
22
|
|
@@ -84,13 +84,13 @@ exports[`Multi-block selection should forward delete across blocks 1`] = `
|
|
84
84
|
<!-- /wp:paragraph -->
|
85
85
|
|
86
86
|
<!-- wp:heading -->
|
87
|
-
<h2>]2</h2>
|
87
|
+
<h2 class=\\"wp-block-heading\\">]2</h2>
|
88
88
|
<!-- /wp:heading -->"
|
89
89
|
`;
|
90
90
|
|
91
91
|
exports[`Multi-block selection should forward delete across blocks 2`] = `
|
92
92
|
"<!-- wp:heading -->
|
93
|
-
<h2>1&2</h2>
|
93
|
+
<h2 class=\\"wp-block-heading\\">1&2</h2>
|
94
94
|
<!-- /wp:heading -->"
|
95
95
|
`;
|
96
96
|
|
@@ -128,7 +128,7 @@ exports[`Multi-block selection should handle Enter across blocks 1`] = `
|
|
128
128
|
<!-- /wp:paragraph -->
|
129
129
|
|
130
130
|
<!-- wp:heading -->
|
131
|
-
<h2>]2</h2>
|
131
|
+
<h2 class=\\"wp-block-heading\\">]2</h2>
|
132
132
|
<!-- /wp:heading -->"
|
133
133
|
`;
|
134
134
|
|
@@ -142,7 +142,7 @@ exports[`Multi-block selection should handle Enter across blocks 2`] = `
|
|
142
142
|
<!-- /wp:paragraph -->
|
143
143
|
|
144
144
|
<!-- wp:heading -->
|
145
|
-
<h2>2</h2>
|
145
|
+
<h2 class=\\"wp-block-heading\\">2</h2>
|
146
146
|
<!-- /wp:heading -->"
|
147
147
|
`;
|
148
148
|
|
@@ -32,7 +32,7 @@ exports[`RichText should handle Home and End keys 1`] = `
|
|
32
32
|
|
33
33
|
exports[`RichText should handle change in tag name gracefully 1`] = `
|
34
34
|
"<!-- wp:heading {\\"level\\":3} -->
|
35
|
-
<h3></h3>
|
35
|
+
<h3 class=\\"wp-block-heading\\"></h3>
|
36
36
|
<!-- /wp:heading -->"
|
37
37
|
`;
|
38
38
|
|
@@ -16,7 +16,9 @@ describe( 'a11y', () => {
|
|
16
16
|
|
17
17
|
it( 'tabs header bar', async () => {
|
18
18
|
await pressKeyWithModifier( 'ctrl', '`' );
|
19
|
-
|
19
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
20
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
21
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
20
22
|
await page.keyboard.press( 'Tab' );
|
21
23
|
|
22
24
|
const isFocusedToggle = await page.$eval(
|
@@ -111,16 +111,14 @@ describe( 'Navigating the block hierarchy', () => {
|
|
111
111
|
|
112
112
|
// Move focus to the sidebar area.
|
113
113
|
await pressKeyWithModifier( 'ctrl', '`' );
|
114
|
-
await pressKeyWithModifier( 'ctrl', '`' );
|
115
|
-
await pressKeyWithModifier( 'ctrl', '`' );
|
116
114
|
await tabToColumnsControl();
|
117
115
|
|
118
116
|
// Tweak the columns count by increasing it by one.
|
119
117
|
await page.keyboard.press( 'ArrowRight' );
|
120
118
|
|
121
119
|
// Navigate to the third column in the columns block.
|
122
|
-
await pressKeyWithModifier( '
|
123
|
-
await pressKeyWithModifier( '
|
120
|
+
await pressKeyWithModifier( 'ctrlShift', '`' );
|
121
|
+
await pressKeyWithModifier( 'ctrlShift', '`' );
|
124
122
|
await pressKeyTimes( 'Tab', 4 );
|
125
123
|
await pressKeyTimes( 'ArrowDown', 4 );
|
126
124
|
await page.waitForSelector(
|
@@ -16,8 +16,8 @@ describe( 'Block Switcher', () => {
|
|
16
16
|
|
17
17
|
it( 'Should show the expected block transforms on the list block when the blocks are removed', async () => {
|
18
18
|
// Insert a list block.
|
19
|
-
await
|
20
|
-
await page.keyboard.type( 'List content' );
|
19
|
+
await page.keyboard.press( 'Enter' );
|
20
|
+
await page.keyboard.type( '- List content' );
|
21
21
|
await page.keyboard.press( 'ArrowUp' );
|
22
22
|
await pressKeyWithModifier( 'alt', 'F10' );
|
23
23
|
|
@@ -43,8 +43,8 @@ describe( 'Block Switcher', () => {
|
|
43
43
|
} );
|
44
44
|
|
45
45
|
// Insert a list block.
|
46
|
-
await
|
47
|
-
await page.keyboard.type( 'List content' );
|
46
|
+
await page.keyboard.press( 'Enter' );
|
47
|
+
await page.keyboard.type( '- List content' );
|
48
48
|
await page.keyboard.press( 'ArrowUp' );
|
49
49
|
await pressKeyWithModifier( 'alt', 'F10' );
|
50
50
|
|
@@ -63,6 +63,10 @@ describe( 'Block Switcher', () => {
|
|
63
63
|
} );
|
64
64
|
|
65
65
|
it( 'Should not show the block switcher if all the blocks the list block transforms into are removed', async () => {
|
66
|
+
// Insert a list block.
|
67
|
+
await page.keyboard.press( 'Enter' );
|
68
|
+
await page.keyboard.type( '- List content' );
|
69
|
+
|
66
70
|
// Remove the paragraph and quote block from the list of registered blocks.
|
67
71
|
await page.evaluate( () => {
|
68
72
|
[
|
@@ -75,23 +79,20 @@ describe( 'Block Switcher', () => {
|
|
75
79
|
].map( ( block ) => wp.blocks.unregisterBlockType( block ) );
|
76
80
|
} );
|
77
81
|
|
78
|
-
// Insert a list block.
|
79
|
-
await insertBlock( 'List' );
|
80
|
-
await page.keyboard.type( 'List content' );
|
81
82
|
await page.keyboard.press( 'ArrowUp' );
|
82
83
|
await pressKeyWithModifier( 'alt', 'F10' );
|
83
84
|
|
84
85
|
// Verify the block switcher exists.
|
85
|
-
expect( await hasBlockSwitcher() ).
|
86
|
+
expect( await hasBlockSwitcher() ).toBeFalsy();
|
86
87
|
// Verify the correct block transforms appear.
|
87
|
-
expect( await getAvailableBlockTransforms() ).toHaveLength(
|
88
|
+
expect( await getAvailableBlockTransforms() ).toHaveLength( 0 );
|
88
89
|
} );
|
89
90
|
|
90
91
|
describe( 'Conditional tranformation options', () => {
|
91
92
|
describe( 'Columns tranforms', () => {
|
92
93
|
it( 'Should show Columns block only if selected blocks are between limits (1-6)', async () => {
|
93
|
-
await
|
94
|
-
await page.keyboard.type( 'List content' );
|
94
|
+
await page.keyboard.press( 'Enter' );
|
95
|
+
await page.keyboard.type( '- List content' );
|
95
96
|
await page.keyboard.press( 'ArrowUp' );
|
96
97
|
await insertBlock( 'Heading' );
|
97
98
|
await page.keyboard.type( 'I am a header' );
|
@@ -103,8 +104,8 @@ describe( 'Block Switcher', () => {
|
|
103
104
|
);
|
104
105
|
} );
|
105
106
|
it( 'Should NOT show Columns transform only if selected blocks are more than max limit(6)', async () => {
|
106
|
-
await
|
107
|
-
await page.keyboard.type( 'List content' );
|
107
|
+
await page.keyboard.press( 'Enter' );
|
108
|
+
await page.keyboard.type( '- List content' );
|
108
109
|
await page.keyboard.press( 'ArrowUp' );
|
109
110
|
await insertBlock( 'Heading' );
|
110
111
|
await page.keyboard.type( 'I am a header' );
|
@@ -22,9 +22,7 @@ describe( 'Editing modes (visual/HTML)', () => {
|
|
22
22
|
|
23
23
|
it( 'should switch between visual and HTML modes', async () => {
|
24
24
|
// This block should be in "visual" mode by default.
|
25
|
-
let visualBlock = await page.$$(
|
26
|
-
'.block-editor-block-list__layout .block-editor-block-list__block.rich-text'
|
27
|
-
);
|
25
|
+
let visualBlock = await page.$$( '[data-block].rich-text' );
|
28
26
|
expect( visualBlock ).toHaveLength( 1 );
|
29
27
|
|
30
28
|
// Change editing mode from "Visual" to "HTML".
|
@@ -33,7 +31,7 @@ describe( 'Editing modes (visual/HTML)', () => {
|
|
33
31
|
|
34
32
|
// Wait for the block to be converted to HTML editing mode.
|
35
33
|
const htmlBlock = await page.$$(
|
36
|
-
'
|
34
|
+
'[data-block] .block-editor-block-list__block-html-textarea'
|
37
35
|
);
|
38
36
|
expect( htmlBlock ).toHaveLength( 1 );
|
39
37
|
|
@@ -42,9 +40,7 @@ describe( 'Editing modes (visual/HTML)', () => {
|
|
42
40
|
await clickMenuItem( 'Edit visually' );
|
43
41
|
|
44
42
|
// This block should be in "visual" mode by default.
|
45
|
-
visualBlock = await page.$$(
|
46
|
-
'.block-editor-block-list__layout .block-editor-block-list__block.rich-text'
|
47
|
-
);
|
43
|
+
visualBlock = await page.$$( '[data-block].rich-text' );
|
48
44
|
expect( visualBlock ).toHaveLength( 1 );
|
49
45
|
} );
|
50
46
|
|
@@ -23,6 +23,9 @@ const navigateToContentEditorTop = async () => {
|
|
23
23
|
// Use 'Ctrl+`' to return to the top of the editor.
|
24
24
|
await pressKeyWithModifier( 'ctrl', '`' );
|
25
25
|
await pressKeyWithModifier( 'ctrl', '`' );
|
26
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
27
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
28
|
+
await pressKeyWithModifier( 'ctrl', '`' );
|
26
29
|
};
|
27
30
|
|
28
31
|
const tabThroughParagraphBlock = async ( paragraphText ) => {
|
@@ -36,6 +39,10 @@ const tabThroughParagraphBlock = async ( paragraphText ) => {
|
|
36
39
|
|
37
40
|
await page.keyboard.press( 'Tab' );
|
38
41
|
await expect( await getActiveLabel() ).toBe( 'Open document settings' );
|
42
|
+
|
43
|
+
// Need to shift+tab here to end back in the block. If not, we'll be in the next region and it will only require 4 region jumps instead of 5.
|
44
|
+
await pressKeyWithModifier( 'shift', 'Tab' );
|
45
|
+
await expect( await getActiveLabel() ).toBe( 'Paragraph block' );
|
39
46
|
};
|
40
47
|
|
41
48
|
const tabThroughBlockToolbar = async () => {
|
@@ -108,7 +108,7 @@ describe( 'Reusable blocks', () => {
|
|
108
108
|
await insertReusableBlock( 'Surprised greeting block' );
|
109
109
|
|
110
110
|
// Convert block to a regular block.
|
111
|
-
await clickBlockToolbarButton( 'Convert to regular
|
111
|
+
await clickBlockToolbarButton( 'Convert to regular block' );
|
112
112
|
|
113
113
|
// Check that we have a paragraph block on the page.
|
114
114
|
const paragraphBlock = await page.$(
|
@@ -343,7 +343,7 @@ describe( 'Reusable blocks', () => {
|
|
343
343
|
|
344
344
|
// Convert back to regular blocks.
|
345
345
|
await clickBlockToolbarButton( 'Select Reusable block' );
|
346
|
-
await clickBlockToolbarButton( 'Convert to regular
|
346
|
+
await clickBlockToolbarButton( 'Convert to regular block' );
|
347
347
|
await page.waitForXPath( selector, {
|
348
348
|
hidden: true,
|
349
349
|
} );
|
@@ -96,8 +96,6 @@ describe( 'Sidebar', () => {
|
|
96
96
|
|
97
97
|
// Region navigate to Sidebar.
|
98
98
|
await pressKeyWithModifier( 'ctrl', '`' );
|
99
|
-
await pressKeyWithModifier( 'ctrl', '`' );
|
100
|
-
await pressKeyWithModifier( 'ctrl', '`' );
|
101
99
|
|
102
100
|
// Tab lands at first (presumed selected) option "Post".
|
103
101
|
await page.keyboard.press( 'Tab' );
|