@wordpress/e2e-tests 9.17.0 → 9.19.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 +5 -0
- package/package.json +4 -4
- package/plugins/block-context/index.js +3 -2
- package/plugins/block-icons/index.js +5 -40
- package/plugins/custom-post-types.php +28 -0
- package/plugins/disable-post-revisions.php +10 -0
- package/plugins/hide-user-rest-routes.php +38 -0
- package/plugins/inner-blocks-locking-all-embed/index.js +1 -1
- package/plugins/inner-blocks-templates/index.js +20 -15
- package/plugins/interactive-blocks/deferred-store/view.js +0 -3
- package/plugins/interactive-blocks/directive-bind/view.js +0 -3
- package/plugins/interactive-blocks/directive-class/view.js +0 -3
- package/plugins/interactive-blocks/directive-context/view.js +0 -3
- package/plugins/interactive-blocks/directive-each/view.js +0 -3
- package/plugins/interactive-blocks/directive-init/view.js +0 -3
- package/plugins/interactive-blocks/directive-key/view.js +0 -3
- package/plugins/interactive-blocks/directive-on/view.js +0 -3
- package/plugins/interactive-blocks/directive-on-document/view.js +0 -3
- package/plugins/interactive-blocks/directive-on-window/view.js +0 -3
- package/plugins/interactive-blocks/directive-priorities/view.js +0 -3
- package/plugins/interactive-blocks/directive-run/view.js +0 -3
- package/plugins/interactive-blocks/directive-style/view.js +0 -3
- package/plugins/interactive-blocks/directive-text/view.js +0 -3
- package/plugins/interactive-blocks/directive-watch/view.js +0 -3
- package/plugins/interactive-blocks/generator-scope/view.js +0 -3
- package/plugins/interactive-blocks/get-server-context/view.js +0 -3
- package/plugins/interactive-blocks/get-server-state/view.js +0 -3
- package/plugins/interactive-blocks/hydration-timing/view.js +0 -3
- package/plugins/interactive-blocks/hydration-timing-slow/view.js +0 -3
- package/plugins/interactive-blocks/namespace/view.js +0 -3
- package/plugins/interactive-blocks/negation-operator/view.js +0 -3
- package/plugins/interactive-blocks/router-navigate/view.js +0 -3
- package/plugins/interactive-blocks/router-race-condition/view.js +0 -3
- package/plugins/interactive-blocks/router-regions/view.js +0 -3
- package/plugins/interactive-blocks/router-script-modules-alpha/view.js +0 -7
- package/plugins/interactive-blocks/router-script-modules-bravo/view.js +0 -7
- package/plugins/interactive-blocks/router-script-modules-charlie/view.js +0 -7
- package/plugins/interactive-blocks/router-script-modules-wrapper/view.js +0 -3
- package/plugins/interactive-blocks/router-styles-wrapper/view.js +0 -3
- package/plugins/interactive-blocks/store/view.js +0 -3
- package/plugins/interactive-blocks/store-tag/view.js +0 -3
- package/plugins/interactive-blocks/tovdom/view.js +0 -3
- package/plugins/interactive-blocks/tovdom-islands/view.js +0 -3
- package/plugins/interactive-blocks/with-scope/view.js +0 -3
- package/plugins/plugins-api/sidebar.js +18 -0
- package/plugins/view-config-extensibility.php +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-tests",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.19.0",
|
|
4
4
|
"description": "Test plugins and mu-plugins for E2E tests in WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"npm": ">=8.19.2"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@wordpress/interactivity": "^6.
|
|
28
|
-
"@wordpress/interactivity-router": "^2.
|
|
27
|
+
"@wordpress/interactivity": "^6.54.0",
|
|
28
|
+
"@wordpress/interactivity-router": "^2.54.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"y-websocket": "^3.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "5ef24f60261976bb198ad035db24bf81c1fb92b4"
|
|
42
42
|
}
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
category: 'text',
|
|
20
20
|
|
|
21
|
+
template: [ [ 'gutenberg/test-context-consumer', {} ] ],
|
|
22
|
+
templateInsertUpdatesSelection: true,
|
|
23
|
+
|
|
21
24
|
edit: function Edit( { attributes, setAttributes } ) {
|
|
22
25
|
const blockProps = useBlockProps();
|
|
23
26
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
24
|
-
template: [ [ 'gutenberg/test-context-consumer', {} ] ],
|
|
25
27
|
templateLock: 'all',
|
|
26
|
-
templateInsertUpdatesSelection: true,
|
|
27
28
|
} );
|
|
28
29
|
return el(
|
|
29
30
|
'div',
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
registerBlockType( 'test/test-single-svg-icon', {
|
|
20
20
|
apiVersion: 3,
|
|
21
21
|
title: 'TestSimpleSvgIcon',
|
|
22
|
+
template: [ [ 'core/paragraph', { content: 'TestSimpleSvgIcon' } ] ],
|
|
22
23
|
icon: svg,
|
|
23
24
|
category: 'text',
|
|
24
25
|
|
|
@@ -29,14 +30,6 @@
|
|
|
29
30
|
} );
|
|
30
31
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
31
32
|
allowedBlocks: [ 'core/paragraph', 'core/image' ],
|
|
32
|
-
template: [
|
|
33
|
-
[
|
|
34
|
-
'core/paragraph',
|
|
35
|
-
{
|
|
36
|
-
content: 'TestSimpleSvgIcon',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
],
|
|
40
33
|
} );
|
|
41
34
|
return el( 'div', innerBlocksProps );
|
|
42
35
|
},
|
|
@@ -56,6 +49,7 @@
|
|
|
56
49
|
registerBlockType( 'test/test-dash-icon', {
|
|
57
50
|
apiVersion: 3,
|
|
58
51
|
title: 'TestSimpleDashIcon',
|
|
52
|
+
template: [ [ 'core/paragraph', { content: 'TestDashIcon' } ] ],
|
|
59
53
|
icon: 'cart',
|
|
60
54
|
category: 'text',
|
|
61
55
|
|
|
@@ -66,14 +60,6 @@
|
|
|
66
60
|
} );
|
|
67
61
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
68
62
|
allowedBlocks: [ 'core/paragraph', 'core/image' ],
|
|
69
|
-
template: [
|
|
70
|
-
[
|
|
71
|
-
'core/paragraph',
|
|
72
|
-
{
|
|
73
|
-
content: 'TestDashIcon',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
],
|
|
77
63
|
} );
|
|
78
64
|
return el( 'div', innerBlocksProps );
|
|
79
65
|
},
|
|
@@ -93,6 +79,7 @@
|
|
|
93
79
|
registerBlockType( 'test/test-function-icon', {
|
|
94
80
|
apiVersion: 3,
|
|
95
81
|
title: 'TestFunctionIcon',
|
|
82
|
+
template: [ [ 'core/paragraph', { content: 'TestFunctionIcon' } ] ],
|
|
96
83
|
icon() {
|
|
97
84
|
return svg;
|
|
98
85
|
},
|
|
@@ -105,14 +92,6 @@
|
|
|
105
92
|
} );
|
|
106
93
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
107
94
|
allowedBlocks: [ 'core/paragraph', 'core/image' ],
|
|
108
|
-
template: [
|
|
109
|
-
[
|
|
110
|
-
'core/paragraph',
|
|
111
|
-
{
|
|
112
|
-
content: 'TestFunctionIcon',
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
],
|
|
116
95
|
} );
|
|
117
96
|
return el( 'div', innerBlocksProps );
|
|
118
97
|
},
|
|
@@ -132,6 +111,7 @@
|
|
|
132
111
|
registerBlockType( 'test/test-dash-icon-colors', {
|
|
133
112
|
apiVersion: 3,
|
|
134
113
|
title: 'TestDashIconColors',
|
|
114
|
+
template: [ [ 'core/paragraph', { content: 'TestIconColors' } ] ],
|
|
135
115
|
icon: {
|
|
136
116
|
background: '#010000',
|
|
137
117
|
foreground: '#fe0000',
|
|
@@ -146,14 +126,6 @@
|
|
|
146
126
|
} );
|
|
147
127
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
148
128
|
allowedBlocks: [ 'core/paragraph', 'core/image' ],
|
|
149
|
-
template: [
|
|
150
|
-
[
|
|
151
|
-
'core/paragraph',
|
|
152
|
-
{
|
|
153
|
-
content: 'TestIconColors',
|
|
154
|
-
},
|
|
155
|
-
],
|
|
156
|
-
],
|
|
157
129
|
} );
|
|
158
130
|
return el( 'div', innerBlocksProps );
|
|
159
131
|
},
|
|
@@ -173,6 +145,7 @@
|
|
|
173
145
|
registerBlockType( 'test/test-svg-icon-background', {
|
|
174
146
|
apiVersion: 3,
|
|
175
147
|
title: 'TestSvgIconBackground',
|
|
148
|
+
template: [ [ 'core/paragraph', { content: 'TestIconColors' } ] ],
|
|
176
149
|
icon: {
|
|
177
150
|
background: '#010000',
|
|
178
151
|
src: svg,
|
|
@@ -186,14 +159,6 @@
|
|
|
186
159
|
} );
|
|
187
160
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
188
161
|
allowedBlocks: [ 'core/paragraph', 'core/image' ],
|
|
189
|
-
template: [
|
|
190
|
-
[
|
|
191
|
-
'core/paragraph',
|
|
192
|
-
{
|
|
193
|
-
content: 'TestIconColors',
|
|
194
|
-
},
|
|
195
|
-
],
|
|
196
|
-
],
|
|
197
162
|
} );
|
|
198
163
|
return el( 'div', innerBlocksProps );
|
|
199
164
|
},
|
|
@@ -87,6 +87,34 @@ function public_queryable_true_public_true_cpt() {
|
|
|
87
87
|
}
|
|
88
88
|
add_action( 'init', 'public_queryable_true_public_true_cpt' );
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Registers a custom post type with real-time collaboration disabled.
|
|
92
|
+
*/
|
|
93
|
+
function gutenberg_test_register_collaboration_disabled_post_type() {
|
|
94
|
+
register_post_type(
|
|
95
|
+
'rtc_disabled',
|
|
96
|
+
array(
|
|
97
|
+
'label' => 'RTC Disabled',
|
|
98
|
+
'show_in_rest' => true,
|
|
99
|
+
'public' => true,
|
|
100
|
+
'supports' => array( 'title', 'editor', 'revisions' ),
|
|
101
|
+
)
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
add_action( 'init', 'gutenberg_test_register_collaboration_disabled_post_type' );
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Disables real-time collaboration for the test post type.
|
|
108
|
+
*
|
|
109
|
+
* @param bool $disabled Whether collaboration is disabled.
|
|
110
|
+
* @param string $post_type Post type name.
|
|
111
|
+
* @return bool Whether collaboration is disabled.
|
|
112
|
+
*/
|
|
113
|
+
function gutenberg_test_disable_post_type_collaboration( $disabled, $post_type ) {
|
|
114
|
+
return 'rtc_disabled' === $post_type ? true : $disabled;
|
|
115
|
+
}
|
|
116
|
+
add_filter( 'wp_is_post_type_collaboration_disabled', 'gutenberg_test_disable_post_type_collaboration', 10, 2 );
|
|
117
|
+
|
|
90
118
|
/**
|
|
91
119
|
* Registers a custom post type that is hierarchical and does not supports the title attribute.
|
|
92
120
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: Gutenberg Test Plugin, Disable Post Revisions
|
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
5
|
+
* Author: Gutenberg Team
|
|
6
|
+
*
|
|
7
|
+
* @package gutenberg-test-disable-post-revisions
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
add_filter( 'wp_revisions_to_keep', '__return_zero' );
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: Gutenberg Test Plugin, Hide User REST Routes
|
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
5
|
+
* Author: Gutenberg Team
|
|
6
|
+
*
|
|
7
|
+
* @package gutenberg-test-hide-user-rest-routes
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Removes the main Users REST routes for requests carrying the test cookie.
|
|
12
|
+
* Application Password routes remain registered, matching sites that hide
|
|
13
|
+
* public user profiles while keeping application authentication available.
|
|
14
|
+
*
|
|
15
|
+
* @param array $endpoints Registered REST endpoints.
|
|
16
|
+
* @return array Filtered REST endpoints.
|
|
17
|
+
*/
|
|
18
|
+
function gutenberg_test_hide_user_rest_routes( $endpoints ) {
|
|
19
|
+
$hide_user_routes = isset( $_COOKIE['gutenberg_test_hide_user_rest_routes'] )
|
|
20
|
+
? sanitize_text_field( wp_unslash( $_COOKIE['gutenberg_test_hide_user_rest_routes'] ) )
|
|
21
|
+
: '';
|
|
22
|
+
|
|
23
|
+
if ( '1' !== $hide_user_routes ) {
|
|
24
|
+
return $endpoints;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
foreach ( array_keys( $endpoints ) as $route ) {
|
|
28
|
+
if (
|
|
29
|
+
str_starts_with( $route, '/wp/v2/users' ) &&
|
|
30
|
+
! str_contains( $route, '/application-passwords' )
|
|
31
|
+
) {
|
|
32
|
+
unset( $endpoints[ $route ] );
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return $endpoints;
|
|
37
|
+
}
|
|
38
|
+
add_filter( 'rest_endpoints', 'gutenberg_test_hide_user_rest_routes' );
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
title: 'Test Inner Blocks Locking All Embed',
|
|
24
24
|
icon: 'cart',
|
|
25
25
|
category: 'text',
|
|
26
|
+
template: TEMPLATE,
|
|
26
27
|
|
|
27
28
|
edit: function Edit() {
|
|
28
29
|
const blockProps = useBlockProps();
|
|
29
30
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
30
|
-
template: TEMPLATE,
|
|
31
31
|
templateLock: 'all',
|
|
32
32
|
} );
|
|
33
33
|
return el( 'div', innerBlocksProps );
|
|
@@ -51,15 +51,10 @@
|
|
|
51
51
|
title: 'Test Inner Blocks no locking',
|
|
52
52
|
icon: 'cart',
|
|
53
53
|
category: 'text',
|
|
54
|
+
template: TEMPLATE,
|
|
54
55
|
|
|
55
56
|
edit: function InnerBlocksNoLockingEdit() {
|
|
56
|
-
return el(
|
|
57
|
-
'div',
|
|
58
|
-
useBlockProps(),
|
|
59
|
-
el( InnerBlocks, {
|
|
60
|
-
template: TEMPLATE,
|
|
61
|
-
} )
|
|
62
|
-
);
|
|
57
|
+
return el( 'div', useBlockProps(), el( InnerBlocks ) );
|
|
63
58
|
},
|
|
64
59
|
|
|
65
60
|
save,
|
|
@@ -70,13 +65,13 @@
|
|
|
70
65
|
title: 'Test InnerBlocks locking all',
|
|
71
66
|
icon: 'cart',
|
|
72
67
|
category: 'text',
|
|
68
|
+
template: TEMPLATE,
|
|
73
69
|
|
|
74
70
|
edit: function InnerBlocksBlocksLockingAllEdit() {
|
|
75
71
|
return el(
|
|
76
72
|
'div',
|
|
77
73
|
useBlockProps(),
|
|
78
74
|
el( InnerBlocks, {
|
|
79
|
-
template: TEMPLATE,
|
|
80
75
|
templateLock: 'all',
|
|
81
76
|
} )
|
|
82
77
|
);
|
|
@@ -133,8 +128,23 @@
|
|
|
133
128
|
title: 'Test Inner Blocks Paragraph Placeholder',
|
|
134
129
|
icon: 'cart',
|
|
135
130
|
category: 'text',
|
|
131
|
+
template: TEMPLATE_PARAGRAPH_PLACEHOLDER,
|
|
132
|
+
templateInsertUpdatesSelection: true,
|
|
136
133
|
|
|
137
134
|
edit: function InnerBlocksParagraphPlaceholderEdit() {
|
|
135
|
+
return el( 'div', useBlockProps(), el( InnerBlocks ) );
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
save,
|
|
139
|
+
} );
|
|
140
|
+
|
|
141
|
+
registerBlockType( 'test/test-inner-blocks-deprecated-props', {
|
|
142
|
+
apiVersion: 3,
|
|
143
|
+
title: 'Test Inner Blocks deprecated props',
|
|
144
|
+
icon: 'cart',
|
|
145
|
+
category: 'text',
|
|
146
|
+
|
|
147
|
+
edit: function InnerBlocksDeprecatedPropsEdit() {
|
|
138
148
|
return el(
|
|
139
149
|
'div',
|
|
140
150
|
useBlockProps(),
|
|
@@ -153,6 +163,7 @@
|
|
|
153
163
|
title: 'Test Inner Blocks transformer target',
|
|
154
164
|
icon: 'cart',
|
|
155
165
|
category: 'text',
|
|
166
|
+
template: TEMPLATE,
|
|
156
167
|
|
|
157
168
|
transforms: {
|
|
158
169
|
from: [
|
|
@@ -189,13 +200,7 @@
|
|
|
189
200
|
},
|
|
190
201
|
|
|
191
202
|
edit: function InnerBlocksTransformerTargetEdit() {
|
|
192
|
-
return el(
|
|
193
|
-
'div',
|
|
194
|
-
useBlockProps(),
|
|
195
|
-
el( InnerBlocks, {
|
|
196
|
-
template: TEMPLATE,
|
|
197
|
-
} )
|
|
198
|
-
);
|
|
203
|
+
return el( 'div', useBlockProps(), el( InnerBlocks ) );
|
|
199
204
|
},
|
|
200
205
|
|
|
201
206
|
save,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { store } from '@wordpress/interactivity';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
2
|
// eslint-disable-next-line import/no-unresolved
|
|
10
3
|
import nameStatic from 'test/router-script-modules-alpha-1';
|
|
11
4
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { store } from '@wordpress/interactivity';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
2
|
// eslint-disable-next-line import/no-unresolved
|
|
10
3
|
import nameStatic from 'test/router-script-modules-bravo-1';
|
|
11
4
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
1
|
import { store } from '@wordpress/interactivity';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* External dependencies
|
|
8
|
-
*/
|
|
9
2
|
// eslint-disable-next-line import/no-unresolved
|
|
10
3
|
import nameStatic from 'test/router-script-modules-charlie-1';
|
|
11
4
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -88,4 +88,22 @@
|
|
|
88
88
|
icon: 'text',
|
|
89
89
|
render: MySidebarPlugin,
|
|
90
90
|
} );
|
|
91
|
+
|
|
92
|
+
// A pinnable sidebar without a PluginSidebarMoreMenuItem of its own, so the
|
|
93
|
+
// only More Menu item for it is the one PluginSidebar injects.
|
|
94
|
+
function MyInjectedItemSidebarPlugin() {
|
|
95
|
+
return el(
|
|
96
|
+
PluginSidebar,
|
|
97
|
+
{
|
|
98
|
+
name: 'injected-item-sidebar',
|
|
99
|
+
title: __( 'Injected menu item' ),
|
|
100
|
+
},
|
|
101
|
+
el( PanelBody, {}, __( 'Injected menu item content' ) )
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
registerPlugin( 'my-injected-item-sidebar-plugin', {
|
|
106
|
+
icon: 'text',
|
|
107
|
+
render: MyInjectedItemSidebarPlugin,
|
|
108
|
+
} );
|
|
91
109
|
} )();
|