@wordpress/e2e-tests 8.3.0 → 8.5.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 +4 -0
- package/package.json +9 -9
- package/plugins/block-bindings.php +13 -3
- package/plugins/delete-installed-fonts.php +1 -1
- package/plugins/interactive-blocks/directive-each/render.php +2 -2
- package/plugins/interactive-blocks/directive-each/view.js +8 -2
- package/plugins/interactive-blocks/directive-priorities/view.js +5 -5
- package/plugins/observe-typing/index.js +45 -0
- package/plugins/observe-typing.php +28 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "8.
|
3
|
+
"version": "8.5.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",
|
@@ -24,13 +24,13 @@
|
|
24
24
|
"npm": ">=8.19.2"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@wordpress/e2e-test-utils": "^11.
|
28
|
-
"@wordpress/interactivity": "^6.
|
29
|
-
"@wordpress/interactivity-router": "^2.
|
30
|
-
"@wordpress/jest-console": "^8.
|
31
|
-
"@wordpress/jest-puppeteer-axe": "^7.
|
32
|
-
"@wordpress/scripts": "^28.
|
33
|
-
"@wordpress/url": "^4.
|
27
|
+
"@wordpress/e2e-test-utils": "^11.5.0",
|
28
|
+
"@wordpress/interactivity": "^6.5.0",
|
29
|
+
"@wordpress/interactivity-router": "^2.5.0",
|
30
|
+
"@wordpress/jest-console": "^8.5.0",
|
31
|
+
"@wordpress/jest-puppeteer-axe": "^7.5.0",
|
32
|
+
"@wordpress/scripts": "^28.5.0",
|
33
|
+
"@wordpress/url": "^4.5.0",
|
34
34
|
"chalk": "^4.0.0",
|
35
35
|
"expect-puppeteer": "^4.4.0",
|
36
36
|
"filenamify": "^4.2.0",
|
@@ -47,5 +47,5 @@
|
|
47
47
|
"publishConfig": {
|
48
48
|
"access": "public"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "c3101ab024e2bfc85d525c6d247e0d57cafc9fd9"
|
51
51
|
}
|
@@ -8,9 +8,19 @@
|
|
8
8
|
*/
|
9
9
|
|
10
10
|
/**
|
11
|
-
* Register custom fields.
|
11
|
+
* Register custom fields and custom block bindings sources.
|
12
12
|
*/
|
13
|
-
function
|
13
|
+
function gutenberg_test_block_bindings_registration() {
|
14
|
+
// Register custom block bindings sources.
|
15
|
+
register_block_bindings_source(
|
16
|
+
'core/server-source',
|
17
|
+
array(
|
18
|
+
'label' => 'Server Source',
|
19
|
+
'get_value_callback' => function () {},
|
20
|
+
)
|
21
|
+
);
|
22
|
+
|
23
|
+
// Register custom fields.
|
14
24
|
register_meta(
|
15
25
|
'post',
|
16
26
|
'text_custom_field',
|
@@ -51,4 +61,4 @@ function gutenberg_test_block_bindings_register_custom_fields() {
|
|
51
61
|
)
|
52
62
|
);
|
53
63
|
}
|
54
|
-
add_action( 'init', '
|
64
|
+
add_action( 'init', 'gutenberg_test_block_bindings_registration' );
|
@@ -56,7 +56,7 @@ function gutenberg_delete_installed_fonts() {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
// Delete any installed fonts from global styles.
|
59
|
-
$global_styles_post_id =
|
59
|
+
$global_styles_post_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
|
60
60
|
$request = new WP_REST_Request( 'POST', '/wp/v2/global-styles/' . $global_styles_post_id );
|
61
61
|
$request->set_body_params( array( 'settings' => array( 'typography' => array( 'fontFamilies' => array() ) ) ) );
|
62
62
|
|
@@ -220,14 +220,14 @@
|
|
220
220
|
<div
|
221
221
|
data-wp-interactive="directive-each"
|
222
222
|
data-wp-router-region="navigation-updated list"
|
223
|
-
data-wp-context='{ "
|
223
|
+
data-wp-context='{ "b": 2, "c": 3, "d": 4 }'
|
224
224
|
data-testid="navigation-updated list"
|
225
225
|
>
|
226
226
|
<button
|
227
227
|
data-testid="navigate"
|
228
228
|
data-wp-on--click="actions.navigate"
|
229
229
|
>Navigate</button>
|
230
|
-
<template data-wp-each="
|
230
|
+
<template data-wp-each="state.list">
|
231
231
|
<p data-wp-text="context.item" data-testid="item"></p>
|
232
232
|
</template>
|
233
233
|
<p data-testid="item" data-wp-each-child>beta</p>
|
@@ -169,14 +169,14 @@ const html = `
|
|
169
169
|
<div
|
170
170
|
data-wp-interactive="directive-each"
|
171
171
|
data-wp-router-region="navigation-updated list"
|
172
|
-
data-wp-context='{ "
|
172
|
+
data-wp-context='{ "a": 1, "b": 2, "c": 3, "d": 4 }'
|
173
173
|
data-testid="navigation-updated list"
|
174
174
|
>
|
175
175
|
<button
|
176
176
|
data-testid="navigate"
|
177
177
|
data-wp-on--click="actions.navigate"
|
178
178
|
>Navigate</button>
|
179
|
-
<template data-wp-each="
|
179
|
+
<template data-wp-each="state.list">
|
180
180
|
<p data-wp-text="context.item" data-testid="item"></p>
|
181
181
|
</template>
|
182
182
|
<p data-testid="item" data-wp-each-child>alpha</p>
|
@@ -187,6 +187,12 @@ const html = `
|
|
187
187
|
`;
|
188
188
|
|
189
189
|
store( 'directive-each', {
|
190
|
+
state: {
|
191
|
+
get list() {
|
192
|
+
const ctx = getContext();
|
193
|
+
return Object.keys( ctx ).sort();
|
194
|
+
},
|
195
|
+
},
|
190
196
|
actions: {
|
191
197
|
*navigate() {
|
192
198
|
const { actions } = yield import(
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
privateApis,
|
9
9
|
} from '@wordpress/interactivity';
|
10
10
|
|
11
|
-
const { directive,
|
11
|
+
const { directive, proxifyState, h } = privateApis(
|
12
12
|
'I acknowledge that using private APIs means my theme or plugin will inevitably break in the next version of WordPress.'
|
13
13
|
);
|
14
14
|
|
@@ -41,12 +41,12 @@ directive(
|
|
41
41
|
'test-context',
|
42
42
|
( { context: { Provider }, props: { children } } ) => {
|
43
43
|
executionProof( 'context' );
|
44
|
-
const value =
|
45
|
-
[ namespace ]: {
|
44
|
+
const value = {
|
45
|
+
[ namespace ]: proxifyState( namespace, {
|
46
46
|
attribute: 'from context',
|
47
47
|
text: 'from context',
|
48
|
-
},
|
49
|
-
}
|
48
|
+
} ),
|
49
|
+
};
|
50
50
|
return h( Provider, { value }, children );
|
51
51
|
},
|
52
52
|
{ priority: 8 }
|
@@ -0,0 +1,45 @@
|
|
1
|
+
( function () {
|
2
|
+
const { registerBlockType } = wp.blocks;
|
3
|
+
const { useBlockProps, BlockControls } = wp.blockEditor;
|
4
|
+
const { Dropdown, ToolbarButton, TextControl } = wp.components;
|
5
|
+
const { createElement: el, useState } = wp.element;
|
6
|
+
|
7
|
+
registerBlockType( 'e2e-tests/observe-typing', {
|
8
|
+
apiVersion: 3,
|
9
|
+
title: 'Observe Typing',
|
10
|
+
description: 'Observe Typing test block.',
|
11
|
+
category: 'widgets',
|
12
|
+
edit: function Edit() {
|
13
|
+
const [ value, setValue ] = useState( '' );
|
14
|
+
const blockProps = useBlockProps();
|
15
|
+
|
16
|
+
return el(
|
17
|
+
'div',
|
18
|
+
blockProps,
|
19
|
+
el(
|
20
|
+
BlockControls,
|
21
|
+
{ group: 'block' },
|
22
|
+
el( Dropdown, {
|
23
|
+
renderToggle: ( { onToggle } ) =>
|
24
|
+
el(
|
25
|
+
ToolbarButton,
|
26
|
+
{
|
27
|
+
onClick: onToggle,
|
28
|
+
},
|
29
|
+
'Open Dropdown'
|
30
|
+
),
|
31
|
+
renderContent: () =>
|
32
|
+
el( TextControl, {
|
33
|
+
label: 'Dropdown field',
|
34
|
+
value,
|
35
|
+
onChange: setValue,
|
36
|
+
__next40pxDefaultSize: true,
|
37
|
+
} ),
|
38
|
+
} )
|
39
|
+
),
|
40
|
+
el( 'p', {}, 'Hello Editor!' )
|
41
|
+
);
|
42
|
+
},
|
43
|
+
save: () => null,
|
44
|
+
} );
|
45
|
+
} )();
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* Plugin Name: Gutenberg Test Observe Typing
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
5
|
+
* Author: Gutenberg Team
|
6
|
+
*
|
7
|
+
* @package gutenberg-test-block-api
|
8
|
+
*/
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Registers a custom script for the plugin.
|
12
|
+
*/
|
13
|
+
function enqueue_observe_typing_plugin_script() {
|
14
|
+
wp_enqueue_script(
|
15
|
+
'gutenberg-test-observe-typing',
|
16
|
+
plugins_url( 'observe-typing/index.js', __FILE__ ),
|
17
|
+
array(
|
18
|
+
'wp-blocks',
|
19
|
+
'wp-block-editor',
|
20
|
+
'wp-components',
|
21
|
+
'wp-element',
|
22
|
+
),
|
23
|
+
filemtime( plugin_dir_path( __FILE__ ) . 'observe-typing/index.js' ),
|
24
|
+
true
|
25
|
+
);
|
26
|
+
}
|
27
|
+
|
28
|
+
add_action( 'init', 'enqueue_observe_typing_plugin_script' );
|