@wordpress/e2e-tests 7.10.0 → 7.11.1
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 +2 -0
- package/jest.config.js +1 -4
- package/package.json +9 -9
- package/plugins/interactive-blocks/directive-body/block.json +14 -0
- package/plugins/interactive-blocks/directive-body/render.php +22 -0
- package/plugins/interactive-blocks/directive-body/view.js +11 -0
- package/plugins/interactive-blocks/directive-class/render.php +11 -0
- package/plugins/interactive-blocks/directive-effect/render.php +12 -0
- package/plugins/interactive-blocks/directive-effect/view.js +7 -0
- package/plugins/interactive-blocks/directive-init/block.json +14 -0
- package/plugins/interactive-blocks/directive-init/render.php +42 -0
- package/plugins/interactive-blocks/directive-init/view.js +64 -0
- package/plugins/interactive-blocks/directive-on/block.json +14 -0
- package/plugins/interactive-blocks/directive-on/render.php +52 -0
- package/plugins/interactive-blocks/directive-on/view.js +27 -0
- package/plugins/interactive-blocks/store-afterload/block.json +14 -0
- package/plugins/interactive-blocks/store-afterload/render.php +41 -0
- package/plugins/interactive-blocks/store-afterload/view.js +60 -0
- package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +2 -2
- package/specs/editor/various/__snapshots__/rich-text.test.js.snap +15 -1
- package/specs/editor/various/block-editor-keyboard-shortcuts.test.js +3 -3
- package/specs/editor/various/reusable-blocks.test.js +4 -4
- package/specs/editor/various/rich-text.test.js +11 -0
- package/specs/experiments/blocks/post-comments-form.test.js +2 -2
- package/assets/large-post.html +0 -5553
- package/assets/small-post-with-containers.html +0 -77
- package/config/performance-reporter.js +0 -177
- package/config/setup-performance-test.js +0 -51
- package/jest.performance.config.js +0 -16
- package/specs/editor/plugins/block-variations.test.js +0 -191
- package/specs/performance/front-end-block-theme.test.js +0 -77
- package/specs/performance/front-end-classic-theme.test.js +0 -77
- package/specs/performance/post-editor.test.js +0 -369
- package/specs/performance/site-editor.test.js +0 -188
- package/specs/performance/utils.js +0 -146
package/CHANGELOG.md
CHANGED
package/jest.config.js
CHANGED
@@ -14,10 +14,7 @@ module.exports = {
|
|
14
14
|
'expect-puppeteer',
|
15
15
|
'puppeteer-testing-library/extend-expect',
|
16
16
|
],
|
17
|
-
testPathIgnorePatterns: [
|
18
|
-
'/node_modules/',
|
19
|
-
'e2e-tests/specs/performance/',
|
20
|
-
],
|
17
|
+
testPathIgnorePatterns: [ '/node_modules/' ],
|
21
18
|
snapshotFormat: {
|
22
19
|
escapeString: false,
|
23
20
|
printBasicPrototype: false,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.11.1",
|
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,16 +23,16 @@
|
|
23
23
|
"node": ">=14"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@wordpress/e2e-test-utils": "^10.
|
27
|
-
"@wordpress/jest-console": "^7.
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^6.
|
29
|
-
"@wordpress/scripts": "^26.
|
30
|
-
"@wordpress/url": "^3.
|
26
|
+
"@wordpress/e2e-test-utils": "^10.11.1",
|
27
|
+
"@wordpress/jest-console": "^7.11.1",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^6.11.1",
|
29
|
+
"@wordpress/scripts": "^26.11.1",
|
30
|
+
"@wordpress/url": "^3.41.1",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
34
|
-
"jest-message-util": "^29.
|
35
|
-
"jest-snapshot": "^29.
|
34
|
+
"jest-message-util": "^29.6.2",
|
35
|
+
"jest-snapshot": "^29.6.2",
|
36
36
|
"puppeteer-testing-library": "^0.5.0",
|
37
37
|
"uuid": "^8.3.0"
|
38
38
|
},
|
@@ -45,5 +45,5 @@
|
|
45
45
|
"publishConfig": {
|
46
46
|
"access": "public"
|
47
47
|
},
|
48
|
-
"gitHead": "
|
48
|
+
"gitHead": "bb1fbf87bb0f451744530fc6a85de2dff1263bed"
|
49
49
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"apiVersion": 2,
|
3
|
+
"name": "test/directive-body",
|
4
|
+
"title": "E2E Interactivity tests - directive body",
|
5
|
+
"category": "text",
|
6
|
+
"icon": "heart",
|
7
|
+
"description": "",
|
8
|
+
"supports": {
|
9
|
+
"interactivity": true
|
10
|
+
},
|
11
|
+
"textdomain": "e2e-interactivity",
|
12
|
+
"viewScript": "directive-body-view",
|
13
|
+
"render": "file:./render.php"
|
14
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* HTML for testing the directive `data-wp-body`.
|
4
|
+
*
|
5
|
+
* @package gutenberg-test-interactive-blocks
|
6
|
+
*/
|
7
|
+
|
8
|
+
?>
|
9
|
+
<div
|
10
|
+
data-wp-interactive
|
11
|
+
data-wp-context='{"text":"text-1"}'
|
12
|
+
>
|
13
|
+
<div data-testid="container">
|
14
|
+
<aside data-wp-body data-testid="element with data-wp-body">
|
15
|
+
<p data-wp-text="context.text" data-testid="text">initial</p>
|
16
|
+
</aside>
|
17
|
+
</div>
|
18
|
+
<button
|
19
|
+
data-wp-on--click="actions.toggleText"
|
20
|
+
data-testid="toggle text"
|
21
|
+
>toggle text</button>
|
22
|
+
</div>
|
@@ -72,4 +72,15 @@
|
|
72
72
|
Toggle context falseValue
|
73
73
|
</button>
|
74
74
|
</div>
|
75
|
+
|
76
|
+
<div
|
77
|
+
data-wp-class--block__element--modifier="state.trueValue"
|
78
|
+
data-testid="can use BEM notation classes"
|
79
|
+
></div>
|
80
|
+
|
81
|
+
<div
|
82
|
+
data-wp-class--main-bg----color="state.trueValue"
|
83
|
+
data-testid="can use classes with several dashes"
|
84
|
+
></div>
|
85
|
+
|
75
86
|
</div>
|
@@ -21,7 +21,19 @@
|
|
21
21
|
|
22
22
|
<div data-wp-effect="effects.changeFocus"></div>
|
23
23
|
|
24
|
+
<div
|
25
|
+
data-testid="short-circuit infinite loops"
|
26
|
+
data-wp-effect="effects.infiniteLoop"
|
27
|
+
data-wp-text="state.counter"
|
28
|
+
>
|
29
|
+
0
|
30
|
+
</div>
|
31
|
+
|
24
32
|
<button data-testid="toggle" data-wp-on--click="actions.toggle">
|
25
33
|
Update
|
26
34
|
</button>
|
35
|
+
|
36
|
+
<button data-testid="increment" data-wp-on--click="actions.increment">
|
37
|
+
Increment
|
38
|
+
</button>
|
27
39
|
</div>
|
@@ -21,6 +21,7 @@
|
|
21
21
|
state: {
|
22
22
|
isOpen: true,
|
23
23
|
isElementInTheDOM: false,
|
24
|
+
counter: 0,
|
24
25
|
},
|
25
26
|
selectors: {
|
26
27
|
elementInTheDOM: ( { state } ) =>
|
@@ -32,6 +33,9 @@
|
|
32
33
|
toggle( { state } ) {
|
33
34
|
state.isOpen = ! state.isOpen;
|
34
35
|
},
|
36
|
+
increment( { state } ) {
|
37
|
+
state.counter = state.counter + 1;
|
38
|
+
},
|
35
39
|
},
|
36
40
|
effects: {
|
37
41
|
elementAddedToTheDOM: ( { state } ) => {
|
@@ -46,6 +50,9 @@
|
|
46
50
|
document.querySelector( "[data-testid='input']" ).focus();
|
47
51
|
}
|
48
52
|
},
|
53
|
+
infiniteLoop: ({ state }) => {
|
54
|
+
state.counter = state.counter + 1;
|
55
|
+
}
|
49
56
|
},
|
50
57
|
} );
|
51
58
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"apiVersion": 2,
|
3
|
+
"name": "test/directive-init",
|
4
|
+
"title": "E2E Interactivity tests - directive init",
|
5
|
+
"category": "text",
|
6
|
+
"icon": "heart",
|
7
|
+
"description": "",
|
8
|
+
"supports": {
|
9
|
+
"interactivity": true
|
10
|
+
},
|
11
|
+
"textdomain": "e2e-interactivity",
|
12
|
+
"viewScript": "directive-init-view",
|
13
|
+
"render": "file:./render.php"
|
14
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* HTML for testing the directive `data-wp-init`.
|
4
|
+
*
|
5
|
+
* @package gutenberg-test-interactive-blocks
|
6
|
+
*/
|
7
|
+
|
8
|
+
?>
|
9
|
+
<div data-wp-interactive>
|
10
|
+
<div
|
11
|
+
data-testid="single init"
|
12
|
+
data-wp-context='{"isReady":[false],"calls":[0]}'
|
13
|
+
data-wp-init="actions.initOne"
|
14
|
+
>
|
15
|
+
<p data-wp-text="selector.isReady" data-testid="isReady">false</p>
|
16
|
+
<p data-wp-text="selector.calls" data-testid="calls">0</p>
|
17
|
+
<button data-wp-on--click="actions.reset">reset</button>
|
18
|
+
</div>
|
19
|
+
<div
|
20
|
+
data-testid="multiple inits"
|
21
|
+
data-wp-context='{"isReady":[false,false],"calls":[0,0]}'
|
22
|
+
data-wp-init--one="actions.initOne"
|
23
|
+
data-wp-init--two="actions.initTwo"
|
24
|
+
>
|
25
|
+
<p data-wp-text="selector.isReady" data-testid="isReady">false,false</p>
|
26
|
+
<p data-wp-text="selector.calls" data-testid="calls">0,0</p>
|
27
|
+
</div>
|
28
|
+
<div
|
29
|
+
data-testid="init show"
|
30
|
+
data-wp-context='{"isVisible":true,"isMounted":false}'
|
31
|
+
>
|
32
|
+
<div data-wp-show-mock="context.isVisible" data-testid="show">
|
33
|
+
<span data-wp-init="actions.initMount">Initially visible</span>
|
34
|
+
</div>
|
35
|
+
<button data-wp-on--click="actions.toggle" data-testid="toggle">
|
36
|
+
toggle
|
37
|
+
</button>
|
38
|
+
<p data-wp-text="selector.isMounted" data-testid="isMounted">
|
39
|
+
true
|
40
|
+
</p>
|
41
|
+
</div>
|
42
|
+
</div>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
( ( { wp } ) => {
|
2
|
+
const { store, directive, useContext } = wp.interactivity;
|
3
|
+
|
4
|
+
// Mock `data-wp-show` directive to test when things are removed from the
|
5
|
+
// DOM. Replace with `data-wp-show` when it's ready.
|
6
|
+
directive(
|
7
|
+
'show-mock',
|
8
|
+
( {
|
9
|
+
directives: {
|
10
|
+
'show-mock': { default: showMock },
|
11
|
+
},
|
12
|
+
element,
|
13
|
+
evaluate,
|
14
|
+
context,
|
15
|
+
} ) => {
|
16
|
+
const contextValue = useContext( context );
|
17
|
+
if ( ! evaluate( showMock, { context: contextValue } ) ) {
|
18
|
+
return null;
|
19
|
+
}
|
20
|
+
return element;
|
21
|
+
}
|
22
|
+
);
|
23
|
+
|
24
|
+
|
25
|
+
store( {
|
26
|
+
selector: {
|
27
|
+
isReady: ({ context: { isReady } }) => {
|
28
|
+
return isReady
|
29
|
+
.map(v => v ? 'true': 'false')
|
30
|
+
.join(',');
|
31
|
+
},
|
32
|
+
calls: ({ context: { calls } }) => {
|
33
|
+
return calls.join(',');
|
34
|
+
},
|
35
|
+
isMounted: ({ context }) => {
|
36
|
+
return context.isMounted ? 'true' : 'false';
|
37
|
+
},
|
38
|
+
},
|
39
|
+
actions: {
|
40
|
+
initOne: ( { context: { isReady, calls } } ) => {
|
41
|
+
isReady[0] = true;
|
42
|
+
// Subscribe to changes in that prop.
|
43
|
+
isReady[0] = isReady[0];
|
44
|
+
calls[0]++;
|
45
|
+
},
|
46
|
+
initTwo: ( { context: { isReady, calls } } ) => {
|
47
|
+
isReady[1] = true;
|
48
|
+
calls[1]++;
|
49
|
+
},
|
50
|
+
initMount: ( { context } ) => {
|
51
|
+
context.isMounted = true;
|
52
|
+
return () => {
|
53
|
+
context.isMounted = false;
|
54
|
+
}
|
55
|
+
},
|
56
|
+
reset: ( { context: { isReady } } ) => {
|
57
|
+
isReady.fill(false);
|
58
|
+
},
|
59
|
+
toggle: ( { context } ) => {
|
60
|
+
context.isVisible = ! context.isVisible;
|
61
|
+
},
|
62
|
+
},
|
63
|
+
} );
|
64
|
+
} )( window );
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"apiVersion": 2,
|
3
|
+
"name": "test/directive-on",
|
4
|
+
"title": "E2E Interactivity tests - directive on",
|
5
|
+
"category": "text",
|
6
|
+
"icon": "heart",
|
7
|
+
"description": "",
|
8
|
+
"supports": {
|
9
|
+
"interactivity": true
|
10
|
+
},
|
11
|
+
"textdomain": "e2e-interactivity",
|
12
|
+
"viewScript": "directive-on-view",
|
13
|
+
"render": "file:./render.php"
|
14
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* HTML for testing the directive `data-wp-on`.
|
4
|
+
*
|
5
|
+
* @package gutenberg-test-interactive-blocks
|
6
|
+
*/
|
7
|
+
|
8
|
+
?>
|
9
|
+
<div data-wp-interactive>
|
10
|
+
<div>
|
11
|
+
<p data-wp-text="state.counter" data-testid="counter">0</p>
|
12
|
+
<button
|
13
|
+
data-testid="button"
|
14
|
+
data-wp-on--click="actions.clickHandler"
|
15
|
+
>Click me!</button>
|
16
|
+
</div>
|
17
|
+
<div>
|
18
|
+
<p data-wp-text="state.text" data-testid="text">initial</p>
|
19
|
+
<input
|
20
|
+
type="text"
|
21
|
+
value="initial"
|
22
|
+
data-testid="input"
|
23
|
+
data-wp-on--input="actions.inputHandler"
|
24
|
+
>
|
25
|
+
</div>
|
26
|
+
<div data-wp-context='{"option":"undefined"}'>
|
27
|
+
<p data-wp-text="context.option" data-testid="option">0</p>
|
28
|
+
<select
|
29
|
+
name="pets"
|
30
|
+
value="undefined"
|
31
|
+
data-testid="select"
|
32
|
+
data-wp-on--change="actions.selectHandler"
|
33
|
+
>
|
34
|
+
<option value="undefined">Choose an option...</option>
|
35
|
+
<option value="dog">Dog</option>
|
36
|
+
<option value="cat">Cat</option>
|
37
|
+
</select>
|
38
|
+
</div>
|
39
|
+
<div
|
40
|
+
data-wp-on--customevent="actions.customEventHandler"
|
41
|
+
data-wp-context='{"customEvents":0}'
|
42
|
+
>
|
43
|
+
<p
|
44
|
+
data-wp-text="context.customEvents"
|
45
|
+
data-testid="custom events counter"
|
46
|
+
>0</p>
|
47
|
+
<button
|
48
|
+
data-testid="custom events button"
|
49
|
+
data-wp-on--click="actions.clickHandler"
|
50
|
+
>Click me!</button>
|
51
|
+
</div>
|
52
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
( ( { wp } ) => {
|
2
|
+
const { store } = wp.interactivity;
|
3
|
+
|
4
|
+
store( {
|
5
|
+
state: {
|
6
|
+
counter: 0,
|
7
|
+
text: ''
|
8
|
+
},
|
9
|
+
actions: {
|
10
|
+
clickHandler: ( { state, event } ) => {
|
11
|
+
state.counter += 1;
|
12
|
+
event.target.dispatchEvent(
|
13
|
+
new CustomEvent( 'customevent', { bubbles: true } )
|
14
|
+
);
|
15
|
+
},
|
16
|
+
inputHandler: ( { state, event } ) => {
|
17
|
+
state.text = event.target.value;
|
18
|
+
},
|
19
|
+
selectHandler: ( { context, event } ) => {
|
20
|
+
context.option = event.target.value;
|
21
|
+
},
|
22
|
+
customEventHandler: ({ context }) => {
|
23
|
+
context.customEvents += 1;
|
24
|
+
},
|
25
|
+
},
|
26
|
+
} );
|
27
|
+
} )( window );
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"apiVersion": 2,
|
3
|
+
"name": "test/store-afterload",
|
4
|
+
"title": "E2E Interactivity tests - store afterload",
|
5
|
+
"category": "text",
|
6
|
+
"icon": "heart",
|
7
|
+
"description": "",
|
8
|
+
"supports": {
|
9
|
+
"interactivity": true
|
10
|
+
},
|
11
|
+
"textdomain": "e2e-interactivity",
|
12
|
+
"viewScript": "store-afterload-view",
|
13
|
+
"render": "file:./render.php"
|
14
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* HTML for testing `afterLoad` callbacks added to the store.
|
4
|
+
*
|
5
|
+
* @package gutenberg-test-interactive-blocks
|
6
|
+
*/
|
7
|
+
|
8
|
+
?>
|
9
|
+
<div data-wp-interactive>
|
10
|
+
<h3>Store statuses</h3>
|
11
|
+
<p data-store-status data-wp-text="state.status1">waiting</p>
|
12
|
+
<p data-store-status data-wp-text="state.status2">waiting</p>
|
13
|
+
<p data-store-status data-wp-text="state.status3">waiting</p>
|
14
|
+
<p data-store-status data-wp-text="state.status4">waiting</p>
|
15
|
+
|
16
|
+
<h3><code>afterLoad</code> executions</h3>
|
17
|
+
<p>All stores ready:
|
18
|
+
<span
|
19
|
+
data-testid="all-stores-ready"
|
20
|
+
data-wp-text="state.allStoresReady">
|
21
|
+
>waiting</span>
|
22
|
+
</p>
|
23
|
+
<p>vDOM ready:
|
24
|
+
<span
|
25
|
+
data-testid="vdom-ready"
|
26
|
+
data-wp-text="state.vdomReady">
|
27
|
+
>waiting</span>
|
28
|
+
</p>
|
29
|
+
<p><code>afterLoad</code> exec times:
|
30
|
+
<span
|
31
|
+
data-testid="after-load-exec-times"
|
32
|
+
data-wp-text="state.execTimes.afterLoad">
|
33
|
+
>0</span>
|
34
|
+
</p>
|
35
|
+
<p><code>sharedAfterLoad</code> exec times:
|
36
|
+
<span
|
37
|
+
data-testid="shared-after-load-exec-times"
|
38
|
+
data-wp-text="state.execTimes.sharedAfterLoad">
|
39
|
+
>0</span>
|
40
|
+
</p>
|
41
|
+
</div>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
( ( { wp } ) => {
|
2
|
+
/**
|
3
|
+
* WordPress dependencies
|
4
|
+
*/
|
5
|
+
const { store } = wp.interactivity;
|
6
|
+
|
7
|
+
const afterLoad = ({ state }) => {
|
8
|
+
// Check the state is correctly initialized.
|
9
|
+
const { status1, status2, status3, status4 } = state;
|
10
|
+
state.allStoresReady =
|
11
|
+
[ status1, status2, status3, status4 ]
|
12
|
+
.every( ( t ) => t === 'ready' )
|
13
|
+
.toString();
|
14
|
+
|
15
|
+
// Check the HTML has been processed as well.
|
16
|
+
const selector = '[data-store-status]';
|
17
|
+
state.vdomReady =
|
18
|
+
document.querySelector( selector ) &&
|
19
|
+
Array.from(
|
20
|
+
document.querySelectorAll( selector )
|
21
|
+
).every( ( el ) => el.textContent === 'ready' ).toString();
|
22
|
+
|
23
|
+
// Increment exec times everytime this function runs.
|
24
|
+
state.execTimes.afterLoad += 1;
|
25
|
+
}
|
26
|
+
|
27
|
+
const sharedAfterLoad = ({ state }) => {
|
28
|
+
// Increment exec times everytime this function runs.
|
29
|
+
state.execTimes.sharedAfterLoad += 1;
|
30
|
+
}
|
31
|
+
|
32
|
+
// Case 1: without afterload callback
|
33
|
+
store( {
|
34
|
+
state: { status1: 'ready' },
|
35
|
+
} );
|
36
|
+
|
37
|
+
// Case 2: non-shared afterload callback
|
38
|
+
store( {
|
39
|
+
state: {
|
40
|
+
status2: 'ready',
|
41
|
+
allStoresReady: false,
|
42
|
+
vdomReady: false,
|
43
|
+
execTimes: { afterLoad: 0 },
|
44
|
+
},
|
45
|
+
}, { afterLoad } );
|
46
|
+
|
47
|
+
// Case 3: shared afterload callback
|
48
|
+
store( {
|
49
|
+
state: {
|
50
|
+
status3: 'ready',
|
51
|
+
execTimes: { sharedAfterLoad: 0 },
|
52
|
+
},
|
53
|
+
}, { afterLoad: sharedAfterLoad } );
|
54
|
+
store( {
|
55
|
+
state: {
|
56
|
+
status4: 'ready',
|
57
|
+
execTimes: { sharedAfterLoad: 0 },
|
58
|
+
},
|
59
|
+
}, { afterLoad: sharedAfterLoad } );
|
60
|
+
} )( window );
|
@@ -88,8 +88,8 @@ exports[`Inserting blocks inserts a block in proper place after having clicked \
|
|
88
88
|
<p>First paragraph</p>
|
89
89
|
<!-- /wp:paragraph -->
|
90
90
|
|
91
|
-
<!-- wp:cover {"
|
92
|
-
<div class="wp-block-cover
|
91
|
+
<!-- wp:cover {"layout":{"type":"constrained"}} -->
|
92
|
+
<div class="wp-block-cover"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"></div></div>
|
93
93
|
<!-- /wp:cover -->
|
94
94
|
|
95
95
|
<!-- wp:heading -->
|
@@ -24,6 +24,16 @@ exports[`RichText should apply multiple formats when selection is collapsed 1`]
|
|
24
24
|
<!-- /wp:paragraph -->"
|
25
25
|
`;
|
26
26
|
|
27
|
+
exports[`RichText should copy/paste heading 1`] = `
|
28
|
+
"<!-- wp:heading -->
|
29
|
+
<h2 class="wp-block-heading">Heading</h2>
|
30
|
+
<!-- /wp:heading -->
|
31
|
+
|
32
|
+
<!-- wp:heading -->
|
33
|
+
<h2 class="wp-block-heading">Heading</h2>
|
34
|
+
<!-- /wp:heading -->"
|
35
|
+
`;
|
36
|
+
|
27
37
|
exports[`RichText should handle Home and End keys 1`] = `
|
28
38
|
"<!-- wp:paragraph -->
|
29
39
|
<p>-<strong>12</strong>+</p>
|
@@ -129,7 +139,11 @@ exports[`RichText should paste paragraph contents into list 1`] = `
|
|
129
139
|
|
130
140
|
<!-- wp:list -->
|
131
141
|
<ul><!-- wp:list-item -->
|
132
|
-
<li>1
|
142
|
+
<li>1</li>
|
143
|
+
<!-- /wp:list-item -->
|
144
|
+
|
145
|
+
<!-- wp:list-item -->
|
146
|
+
<li>2</li>
|
133
147
|
<!-- /wp:list-item --></ul>
|
134
148
|
<!-- /wp:list -->"
|
135
149
|
`;
|
@@ -90,9 +90,9 @@ describe( 'block editor keyboard shortcuts', () => {
|
|
90
90
|
} );
|
91
91
|
it( 'should prevent deleting multiple selected blocks from inputs', async () => {
|
92
92
|
await clickBlockToolbarButton( 'Options' );
|
93
|
-
await clickMenuItem( 'Create pattern
|
93
|
+
await clickMenuItem( 'Create pattern' );
|
94
94
|
const reusableBlockNameInputSelector =
|
95
|
-
'.
|
95
|
+
'.patterns-menu-items__convert-modal .components-text-control__input';
|
96
96
|
const nameInput = await page.waitForSelector(
|
97
97
|
reusableBlockNameInputSelector
|
98
98
|
);
|
@@ -102,7 +102,7 @@ describe( 'block editor keyboard shortcuts', () => {
|
|
102
102
|
await page.keyboard.press( 'ArrowLeft' );
|
103
103
|
await page.keyboard.press( 'Delete' );
|
104
104
|
await clickOnCloseModalButton(
|
105
|
-
'.
|
105
|
+
'.patterns-menu-items__convert-modal'
|
106
106
|
);
|
107
107
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
108
108
|
} );
|
@@ -20,11 +20,11 @@ import {
|
|
20
20
|
} from '@wordpress/e2e-test-utils';
|
21
21
|
|
22
22
|
const reusableBlockNameInputSelector =
|
23
|
-
'.
|
23
|
+
'.patterns-menu-items__convert-modal .components-text-control__input';
|
24
24
|
const reusableBlockInspectorNameInputSelector =
|
25
25
|
'.block-editor-block-inspector .components-text-control__input';
|
26
26
|
const syncToggleSelectorChecked =
|
27
|
-
'.
|
27
|
+
'.patterns-menu-items__convert-modal .components-form-toggle.is-checked';
|
28
28
|
|
29
29
|
const saveAll = async () => {
|
30
30
|
const publishButtonSelector =
|
@@ -196,7 +196,7 @@ describe( 'Reusable blocks', () => {
|
|
196
196
|
|
197
197
|
// Convert block to a reusable block.
|
198
198
|
await clickBlockToolbarButton( 'Options' );
|
199
|
-
await clickMenuItem( 'Create pattern
|
199
|
+
await clickMenuItem( 'Create pattern' );
|
200
200
|
|
201
201
|
// Set title.
|
202
202
|
const nameInput = await page.waitForSelector(
|
@@ -382,7 +382,7 @@ describe( 'Reusable blocks', () => {
|
|
382
382
|
|
383
383
|
// Convert to reusable.
|
384
384
|
await clickBlockToolbarButton( 'Options' );
|
385
|
-
await clickMenuItem( 'Create pattern
|
385
|
+
await clickMenuItem( 'Create pattern' );
|
386
386
|
const nameInput = await page.waitForSelector(
|
387
387
|
reusableBlockNameInputSelector
|
388
388
|
);
|
@@ -556,4 +556,15 @@ describe( 'RichText', () => {
|
|
556
556
|
// Expect: <strong>1</strong>-<em>2</em>
|
557
557
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
558
558
|
} );
|
559
|
+
|
560
|
+
test( 'should copy/paste heading', async () => {
|
561
|
+
await insertBlock( 'Heading' );
|
562
|
+
await page.keyboard.type( 'Heading' );
|
563
|
+
await pressKeyWithModifier( 'primary', 'a' );
|
564
|
+
await pressKeyWithModifier( 'primary', 'c' );
|
565
|
+
await page.keyboard.press( 'ArrowRight' );
|
566
|
+
await page.keyboard.press( 'Enter' );
|
567
|
+
await pressKeyWithModifier( 'primary', 'v' );
|
568
|
+
expect( await getEditedPostContent() ).toMatchSnapshot();
|
569
|
+
} );
|
559
570
|
} );
|
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
canvas,
|
12
12
|
} from '@wordpress/e2e-test-utils';
|
13
13
|
|
14
|
-
describe( '
|
14
|
+
describe( 'Comments Form', () => {
|
15
15
|
let previousCommentStatus;
|
16
16
|
|
17
17
|
beforeAll( async () => {
|
@@ -42,7 +42,7 @@ describe( 'Post Comments Form', () => {
|
|
42
42
|
await enterEditMode();
|
43
43
|
|
44
44
|
// Insert post comments form
|
45
|
-
await insertBlock( '
|
45
|
+
await insertBlock( 'Comments Form' );
|
46
46
|
|
47
47
|
// Ensure the placeholder is there
|
48
48
|
await expect( canvas() ).toMatchElement(
|