@wordpress/e2e-tests 8.8.6 → 8.8.8
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 +5 -5
- package/plugins/block-bindings/index.js +0 -1
- package/plugins/block-bindings.php +86 -0
- package/plugins/block-template-registration.php +6 -6
- package/plugins/interactive-blocks/directive-class/render.php +16 -4
- package/plugins/interactive-blocks/directive-class/view.js +2 -2
- package/plugins/interactive-blocks/directive-init/view.js +1 -1
- package/plugins/interactive-blocks/directive-on-document/view.js +1 -1
- package/plugins/interactive-blocks/directive-on-window/view.js +1 -1
- package/plugins/interactive-blocks/directive-run/view.js +1 -3
- package/plugins/interactive-blocks/directive-watch/view.js +1 -1
- package/plugins/interactive-blocks/tovdom-islands/view.js +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "8.8.
|
3
|
+
"version": "8.8.8",
|
4
4
|
"description": "End-To-End (E2E) tests for WordPress.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -25,11 +25,11 @@
|
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
27
|
"@wordpress/e2e-test-utils": "^11.8.2",
|
28
|
-
"@wordpress/interactivity": "^6.8.
|
29
|
-
"@wordpress/interactivity-router": "^2.8.
|
28
|
+
"@wordpress/interactivity": "^6.8.5",
|
29
|
+
"@wordpress/interactivity-router": "^2.8.6",
|
30
30
|
"@wordpress/jest-console": "^8.8.1",
|
31
31
|
"@wordpress/jest-puppeteer-axe": "^7.8.1",
|
32
|
-
"@wordpress/scripts": "^30.0.
|
32
|
+
"@wordpress/scripts": "^30.0.6",
|
33
33
|
"@wordpress/url": "^4.8.1",
|
34
34
|
"chalk": "^4.0.0",
|
35
35
|
"expect-puppeteer": "^4.4.0",
|
@@ -47,5 +47,5 @@
|
|
47
47
|
"publishConfig": {
|
48
48
|
"access": "public"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "b1ace05ee94f0803e51b205306c19fc706499ede"
|
51
51
|
}
|
@@ -21,14 +21,17 @@ function gutenberg_test_block_bindings_registration() {
|
|
21
21
|
'text_field' => array(
|
22
22
|
'label' => 'Text Field Label',
|
23
23
|
'value' => 'Text Field Value',
|
24
|
+
'type' => 'string',
|
24
25
|
),
|
25
26
|
'url_field' => array(
|
26
27
|
'label' => 'URL Field Label',
|
27
28
|
'value' => $testing_url,
|
29
|
+
'type' => 'string',
|
28
30
|
),
|
29
31
|
'empty_field' => array(
|
30
32
|
'label' => 'Empty Field Label',
|
31
33
|
'value' => '',
|
34
|
+
'type' => 'string',
|
32
35
|
),
|
33
36
|
);
|
34
37
|
|
@@ -106,6 +109,89 @@ function gutenberg_test_block_bindings_registration() {
|
|
106
109
|
'type' => 'string',
|
107
110
|
)
|
108
111
|
);
|
112
|
+
// Register different types of custom fields for testing.
|
113
|
+
register_meta(
|
114
|
+
'post',
|
115
|
+
'string_custom_field',
|
116
|
+
array(
|
117
|
+
'label' => 'String custom field',
|
118
|
+
'default' => '',
|
119
|
+
'show_in_rest' => true,
|
120
|
+
'single' => true,
|
121
|
+
'type' => 'string',
|
122
|
+
)
|
123
|
+
);
|
124
|
+
register_meta(
|
125
|
+
'post',
|
126
|
+
'object_custom_field',
|
127
|
+
array(
|
128
|
+
'label' => 'Object custom field',
|
129
|
+
'show_in_rest' => array(
|
130
|
+
'schema' => array(
|
131
|
+
'type' => 'object',
|
132
|
+
'properties' => array(
|
133
|
+
'foo' => array(
|
134
|
+
'type' => 'string',
|
135
|
+
),
|
136
|
+
),
|
137
|
+
),
|
138
|
+
),
|
139
|
+
'single' => true,
|
140
|
+
'type' => 'object',
|
141
|
+
)
|
142
|
+
);
|
143
|
+
register_meta(
|
144
|
+
'post',
|
145
|
+
'array_custom_field',
|
146
|
+
array(
|
147
|
+
'label' => 'Array custom field',
|
148
|
+
'show_in_rest' => array(
|
149
|
+
'schema' => array(
|
150
|
+
'type' => 'array',
|
151
|
+
'items' => array(
|
152
|
+
'type' => 'string',
|
153
|
+
),
|
154
|
+
),
|
155
|
+
),
|
156
|
+
'single' => true,
|
157
|
+
'type' => 'array',
|
158
|
+
'default' => array(),
|
159
|
+
)
|
160
|
+
);
|
161
|
+
register_meta(
|
162
|
+
'post',
|
163
|
+
'number',
|
164
|
+
array(
|
165
|
+
'label' => 'Number custom field',
|
166
|
+
'type' => 'number',
|
167
|
+
'show_in_rest' => true,
|
168
|
+
'single' => true,
|
169
|
+
'default' => 5.5,
|
170
|
+
)
|
171
|
+
);
|
172
|
+
register_meta(
|
173
|
+
'post',
|
174
|
+
'integer',
|
175
|
+
array(
|
176
|
+
'label' => 'Integer custom field',
|
177
|
+
'type' => 'integer',
|
178
|
+
'show_in_rest' => true,
|
179
|
+
'single' => true,
|
180
|
+
'default' => 5,
|
181
|
+
)
|
182
|
+
);
|
183
|
+
register_meta(
|
184
|
+
'post',
|
185
|
+
'boolean',
|
186
|
+
array(
|
187
|
+
'label' => 'Boolean custom field',
|
188
|
+
'type' => 'boolean',
|
189
|
+
'show_in_rest' => true,
|
190
|
+
'single' => true,
|
191
|
+
'default' => true,
|
192
|
+
)
|
193
|
+
);
|
194
|
+
|
109
195
|
// Register CPT custom fields.
|
110
196
|
register_meta(
|
111
197
|
'post',
|
@@ -11,7 +11,7 @@ add_action(
|
|
11
11
|
'init',
|
12
12
|
function () {
|
13
13
|
// Custom template used by most tests.
|
14
|
-
|
14
|
+
register_block_template(
|
15
15
|
'gutenberg//plugin-template',
|
16
16
|
array(
|
17
17
|
'title' => 'Plugin Template',
|
@@ -28,7 +28,7 @@ add_action(
|
|
28
28
|
);
|
29
29
|
|
30
30
|
// Custom template overridden by the theme.
|
31
|
-
|
31
|
+
register_block_template(
|
32
32
|
'gutenberg//custom-template',
|
33
33
|
array(
|
34
34
|
'title' => 'Custom Template (overridden by the theme)',
|
@@ -39,7 +39,7 @@ add_action(
|
|
39
39
|
);
|
40
40
|
|
41
41
|
// Custom template used to test unregistration.
|
42
|
-
|
42
|
+
register_block_template(
|
43
43
|
'gutenberg//plugin-unregistered-template',
|
44
44
|
array(
|
45
45
|
'title' => 'Plugin Unregistered Template',
|
@@ -47,10 +47,10 @@ add_action(
|
|
47
47
|
'content' => '<!-- wp:template-part {"slug":"header","tagName":"header"} /--><!-- wp:group {"tagName":"main","layout":{"inherit":true}} --><main class="wp-block-group"><!-- wp:paragraph --><p>This is a plugin-registered template that is also unregistered.</p><!-- /wp:paragraph --></main><!-- /wp:group -->',
|
48
48
|
)
|
49
49
|
);
|
50
|
-
|
50
|
+
unregister_block_template( 'gutenberg//plugin-unregistered-template' );
|
51
51
|
|
52
52
|
// Custom template used to test overriding default WP templates.
|
53
|
-
|
53
|
+
register_block_template(
|
54
54
|
'gutenberg//page',
|
55
55
|
array(
|
56
56
|
'title' => 'Plugin Page Template',
|
@@ -60,7 +60,7 @@ add_action(
|
|
60
60
|
);
|
61
61
|
|
62
62
|
// Custom template used to test overriding default WP templates which can be created by the user.
|
63
|
-
|
63
|
+
register_block_template(
|
64
64
|
'gutenberg//author-admin',
|
65
65
|
array(
|
66
66
|
'title' => 'Plugin Author Template',
|
@@ -59,17 +59,17 @@
|
|
59
59
|
data-testid="can toggle class when class attribute is missing"
|
60
60
|
></div>
|
61
61
|
|
62
|
-
<div data-wp-context='{ "
|
62
|
+
<div data-wp-context='{ "value": false }'>
|
63
63
|
<div
|
64
64
|
class="foo"
|
65
|
-
data-wp-class--foo="context.
|
65
|
+
data-wp-class--foo="context.value"
|
66
66
|
data-testid="can use context values"
|
67
67
|
></div>
|
68
68
|
<button
|
69
|
-
data-wp-on--click="actions.
|
69
|
+
data-wp-on--click="actions.toggleContextValue"
|
70
70
|
data-testid="toggle context false value"
|
71
71
|
>
|
72
|
-
Toggle context
|
72
|
+
Toggle context value
|
73
73
|
</button>
|
74
74
|
</div>
|
75
75
|
|
@@ -83,4 +83,16 @@
|
|
83
83
|
data-testid="can use classes with several dashes"
|
84
84
|
></div>
|
85
85
|
|
86
|
+
<div data-wp-context='{ "value": false }'>
|
87
|
+
<div
|
88
|
+
data-wp-class--default="context.value"
|
89
|
+
data-testid="class name default"
|
90
|
+
></div>
|
91
|
+
<button
|
92
|
+
data-wp-on--click="actions.toggleContextValue"
|
93
|
+
data-testid="toggle class name default"
|
94
|
+
>
|
95
|
+
Toggle context val
|
96
|
+
</button>
|
97
|
+
</div>
|
86
98
|
</div>
|
@@ -15,9 +15,9 @@ const { state } = store( 'directive-class', {
|
|
15
15
|
toggleFalseValue: () => {
|
16
16
|
state.falseValue = ! state.falseValue;
|
17
17
|
},
|
18
|
-
|
18
|
+
toggleContextValue: () => {
|
19
19
|
const context = getContext();
|
20
|
-
context.
|
20
|
+
context.value = ! context.value;
|
21
21
|
},
|
22
22
|
},
|
23
23
|
} );
|
@@ -12,7 +12,7 @@ const { directive } = privateApis(
|
|
12
12
|
directive(
|
13
13
|
'show-mock',
|
14
14
|
( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
|
15
|
-
const entry = showMock.find( ( { suffix } ) => suffix ===
|
15
|
+
const entry = showMock.find( ( { suffix } ) => suffix === null );
|
16
16
|
if ( ! evaluate( entry ) ) {
|
17
17
|
return null;
|
18
18
|
}
|
@@ -12,7 +12,7 @@ const { directive } = privateApis(
|
|
12
12
|
directive(
|
13
13
|
'show-mock',
|
14
14
|
( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
|
15
|
-
const entry = showMock.find( ( { suffix } ) => suffix ===
|
15
|
+
const entry = showMock.find( ( { suffix } ) => suffix === null );
|
16
16
|
if ( ! evaluate( entry ) ) {
|
17
17
|
return null;
|
18
18
|
}
|
@@ -12,7 +12,7 @@ const { directive } = privateApis(
|
|
12
12
|
directive(
|
13
13
|
'show-mock',
|
14
14
|
( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
|
15
|
-
const entry = showMock.find( ( { suffix } ) => suffix ===
|
15
|
+
const entry = showMock.find( ( { suffix } ) => suffix === null );
|
16
16
|
if ( ! evaluate( entry ) ) {
|
17
17
|
return null;
|
18
18
|
}
|
@@ -21,9 +21,7 @@ directive(
|
|
21
21
|
element,
|
22
22
|
evaluate,
|
23
23
|
} ) => {
|
24
|
-
const entry = showChildren.find(
|
25
|
-
( { suffix } ) => suffix === 'default'
|
26
|
-
);
|
24
|
+
const entry = showChildren.find( ( { suffix } ) => suffix === null );
|
27
25
|
return evaluate( entry )
|
28
26
|
? element
|
29
27
|
: cloneElement( element, { children: null } );
|
@@ -12,7 +12,7 @@ const { directive } = privateApis(
|
|
12
12
|
directive(
|
13
13
|
'show-mock',
|
14
14
|
( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
|
15
|
-
const entry = showMock.find( ( { suffix } ) => suffix ===
|
15
|
+
const entry = showMock.find( ( { suffix } ) => suffix === null );
|
16
16
|
if ( ! evaluate( entry ) ) {
|
17
17
|
return null;
|
18
18
|
}
|
@@ -12,7 +12,7 @@ const { directive, h } = privateApis(
|
|
12
12
|
directive(
|
13
13
|
'show-mock',
|
14
14
|
( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
|
15
|
-
const entry = showMock.find( ( { suffix } ) => suffix ===
|
15
|
+
const entry = showMock.find( ( { suffix } ) => suffix === null );
|
16
16
|
|
17
17
|
if ( ! evaluate( entry ) ) {
|
18
18
|
element.props.children = h(
|