@wordpress/e2e-tests 9.19.1-next.v.202609031004.0 → 9.20.1-next.v.202609171837.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 +2 -0
- package/mu-plugins/e2e-fast-sync-polling.php +29 -0
- package/package.json +4 -4
- package/plugins/allowed-blocks.php +3 -3
- package/plugins/allowed-patterns-disable-blocks.php +3 -3
- package/plugins/class-test-widget.php +1 -1
- package/plugins/connectors-empty-state.php +2 -2
- package/plugins/image-size-duplicates.php +19 -0
- package/plugins/interactive-blocks/directive-bind/view.js +3 -3
- package/plugins/interactive-blocks/directive-each/view.js +2 -3
- package/plugins/interactive-blocks/directive-key/view.js +2 -3
- package/plugins/interactive-blocks/directive-run/view.js +2 -3
- package/plugins/interactive-blocks/get-server-context/view.js +2 -3
- package/plugins/interactive-blocks/get-server-state/view.js +2 -3
- package/plugins/interactive-blocks/router-navigate/view.js +2 -3
- package/plugins/interactive-blocks/router-regions/view.js +2 -3
- package/plugins/interactive-blocks/router-script-modules-wrapper/view.js +4 -6
- package/plugins/interactive-blocks/router-styles-wrapper/view.js +6 -9
- package/plugins/rtc-websocket-provider/src/index.js +6 -1
- package/plugins/rtc-websocket-provider/src/yjs-external.js +13 -9
- package/plugins/rtc-websocket-provider.php +1 -1
- package/plugins/starter-page-patterns.php +64 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* MU-plugin: Speed up collaboration sync polling in e2e tests.
|
|
4
|
+
*
|
|
5
|
+
* The sync module reads its polling intervals via applyFilters at load time,
|
|
6
|
+
* so the filters must be registered before the wp-sync script executes.
|
|
7
|
+
* Hooked to admin_init so the wp-sync handle is already registered.
|
|
8
|
+
*/
|
|
9
|
+
add_action(
|
|
10
|
+
'enqueue_block_editor_assets',
|
|
11
|
+
function () {
|
|
12
|
+
wp_add_inline_script(
|
|
13
|
+
'wp-sync',
|
|
14
|
+
<<<'JS'
|
|
15
|
+
wp.hooks.addFilter(
|
|
16
|
+
'sync.pollingManager.pollingInterval',
|
|
17
|
+
'e2e-tests',
|
|
18
|
+
() => 500
|
|
19
|
+
);
|
|
20
|
+
wp.hooks.addFilter(
|
|
21
|
+
'sync.pollingManager.pollingIntervalWithCollaborators',
|
|
22
|
+
'e2e-tests',
|
|
23
|
+
() => 100
|
|
24
|
+
);
|
|
25
|
+
JS,
|
|
26
|
+
'before'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-tests",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.20.1-next.v.202609171837.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.55.1-next.v.202609171837.0",
|
|
28
|
+
"@wordpress/interactivity-router": "^2.55.1-next.v.202609171837.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": "7fc9f6676debc888d2f071d17cb71837040d4b48"
|
|
42
42
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Restrict the allowed blocks in the editor.
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @return Array
|
|
13
|
+
* @param Array $allowed_block_types An array of strings containing the previously allowed blocks.
|
|
14
|
+
* @param WP_Post $post The current post object.
|
|
15
|
+
* @return Array An array of strings containing the new allowed blocks after the filter is applied.
|
|
16
16
|
*/
|
|
17
17
|
function my_plugin_allowed_block_types( $allowed_block_types, $post ) {
|
|
18
18
|
if ( 'post' !== $post->post_type ) {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Restrict the allowed blocks in the editor.
|
|
12
12
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @return Array
|
|
13
|
+
* @param Array $allowed_block_types An array of strings containing the previously allowed blocks.
|
|
14
|
+
* @param WP_Post $post The current post object.
|
|
15
|
+
* @return Array An array of strings containing the new allowed blocks after the filter is applied.
|
|
16
16
|
*/
|
|
17
17
|
function my_plugin_allowed_block_types( $allowed_block_types, $post ) {
|
|
18
18
|
if ( 'post' !== $post->post_type ) {
|
|
@@ -25,7 +25,7 @@ class Test_Widget extends WP_Widget {
|
|
|
25
25
|
/**
|
|
26
26
|
* Outputs the content for the widget instance.
|
|
27
27
|
*
|
|
28
|
-
* @param array $args
|
|
28
|
+
* @param array $args Display arguments including 'before_title', 'after_title',
|
|
29
29
|
* 'before_widget', and 'after_widget'.
|
|
30
30
|
* @param array $instance Settings for the current Block widget instance.
|
|
31
31
|
*/
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
* @package gutenberg-test-connectors-empty-state
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
// Remove the
|
|
12
|
+
// Remove the filter that provides default connector data.
|
|
13
13
|
add_action(
|
|
14
14
|
'init',
|
|
15
15
|
static function () {
|
|
16
|
-
remove_filter( 'script_module_data_options-connectors-wp-admin', '
|
|
16
|
+
remove_filter( 'script_module_data_options-connectors-wp-admin', '_wp_connectors_get_connector_script_module_data' );
|
|
17
17
|
},
|
|
18
18
|
PHP_INT_MAX
|
|
19
19
|
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: Gutenberg Test Plugin: Duplicate Image Sizes
|
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
5
|
+
* Author: Gutenberg Team
|
|
6
|
+
*
|
|
7
|
+
* Registers two image sizes with identical dimensions and crop settings so
|
|
8
|
+
* client-side media processing groups them into a single sideload request.
|
|
9
|
+
*
|
|
10
|
+
* @package gutenberg-test-image-size-duplicates
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
add_action(
|
|
14
|
+
'after_setup_theme',
|
|
15
|
+
static function () {
|
|
16
|
+
add_image_size( 'duplicate-size-one', 400, 400, false );
|
|
17
|
+
add_image_size( 'duplicate-size-two', 400, 400, false );
|
|
18
|
+
}
|
|
19
|
+
);
|
|
@@ -23,9 +23,9 @@ const { state, foo } = store( 'directive-bind', {
|
|
|
23
23
|
'previousValue' in context
|
|
24
24
|
? context.previousValue
|
|
25
25
|
: // Any string works here; we just want to toggle the value
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
// to ensure Preact renders the same we are hydrating in the
|
|
27
|
+
// first place.
|
|
28
|
+
'tacocat';
|
|
29
29
|
|
|
30
30
|
context.previousValue = context.value;
|
|
31
31
|
context.value = previousValue;
|
|
@@ -224,9 +224,8 @@ store( 'directive-each', {
|
|
|
224
224
|
},
|
|
225
225
|
actions: {
|
|
226
226
|
*navigate() {
|
|
227
|
-
const { actions } =
|
|
228
|
-
'@wordpress/interactivity-router'
|
|
229
|
-
);
|
|
227
|
+
const { actions } =
|
|
228
|
+
yield import( '@wordpress/interactivity-router' );
|
|
230
229
|
return actions.navigate( window.location, {
|
|
231
230
|
force: true,
|
|
232
231
|
html,
|
|
@@ -15,9 +15,8 @@ const html = `
|
|
|
15
15
|
store( 'directive-key', {
|
|
16
16
|
actions: {
|
|
17
17
|
*navigate() {
|
|
18
|
-
const { actions } =
|
|
19
|
-
'@wordpress/interactivity-router'
|
|
20
|
-
);
|
|
18
|
+
const { actions } =
|
|
19
|
+
yield import( '@wordpress/interactivity-router' );
|
|
21
20
|
return actions.navigate( window.location, {
|
|
22
21
|
force: true,
|
|
23
22
|
html,
|
|
@@ -62,9 +62,8 @@ const { state } = store( 'directive-run', {
|
|
|
62
62
|
state.clickCount = state.clickCount + 1;
|
|
63
63
|
},
|
|
64
64
|
*navigate() {
|
|
65
|
-
const { actions } =
|
|
66
|
-
'@wordpress/interactivity-router'
|
|
67
|
-
);
|
|
65
|
+
const { actions } =
|
|
66
|
+
yield import( '@wordpress/interactivity-router' );
|
|
68
67
|
return actions.navigate( window.location, {
|
|
69
68
|
force: true,
|
|
70
69
|
html,
|
|
@@ -14,9 +14,8 @@ store( 'test/get-server-context', {
|
|
|
14
14
|
actions: {
|
|
15
15
|
navigate: withSyncEvent( function* ( e ) {
|
|
16
16
|
e.preventDefault();
|
|
17
|
-
const { actions } =
|
|
18
|
-
'@wordpress/interactivity-router'
|
|
19
|
-
);
|
|
17
|
+
const { actions } =
|
|
18
|
+
yield import( '@wordpress/interactivity-router' );
|
|
20
19
|
yield actions.navigate( e.target.href );
|
|
21
20
|
} ),
|
|
22
21
|
attemptModification() {
|
|
@@ -9,9 +9,8 @@ const { state } = store( 'test/get-server-state', {
|
|
|
9
9
|
actions: {
|
|
10
10
|
navigate: withSyncEvent( function* ( e ) {
|
|
11
11
|
e.preventDefault();
|
|
12
|
-
const { actions } =
|
|
13
|
-
'@wordpress/interactivity-router'
|
|
14
|
-
);
|
|
12
|
+
const { actions } =
|
|
13
|
+
yield import( '@wordpress/interactivity-router' );
|
|
15
14
|
yield actions.navigate( e.target.href );
|
|
16
15
|
} ),
|
|
17
16
|
attemptModification() {
|
|
@@ -25,9 +25,8 @@ const { state } = store( 'router', {
|
|
|
25
25
|
const force = e.target.dataset.forceNavigation === 'true';
|
|
26
26
|
const { timeout } = state;
|
|
27
27
|
|
|
28
|
-
const { actions } =
|
|
29
|
-
'@wordpress/interactivity-router'
|
|
30
|
-
);
|
|
28
|
+
const { actions } =
|
|
29
|
+
yield import( '@wordpress/interactivity-router' );
|
|
31
30
|
|
|
32
31
|
try {
|
|
33
32
|
yield actions.navigate( e.target.href, { force, timeout } );
|
|
@@ -23,9 +23,8 @@ const { state } = store( 'router-regions', {
|
|
|
23
23
|
router: {
|
|
24
24
|
navigate: withSyncEvent( function* ( e ) {
|
|
25
25
|
e.preventDefault();
|
|
26
|
-
const { actions } =
|
|
27
|
-
'@wordpress/interactivity-router'
|
|
28
|
-
);
|
|
26
|
+
const { actions } =
|
|
27
|
+
yield import( '@wordpress/interactivity-router' );
|
|
29
28
|
yield actions.navigate( e.target.href );
|
|
30
29
|
} ),
|
|
31
30
|
back: withSyncEvent( function* ( e ) {
|
|
@@ -9,17 +9,15 @@ const { state } = store( 'test/router-script-modules', {
|
|
|
9
9
|
*navigate( e ) {
|
|
10
10
|
e.preventDefault();
|
|
11
11
|
state.clientSideNavigation = false;
|
|
12
|
-
const { actions } =
|
|
13
|
-
'@wordpress/interactivity-router'
|
|
14
|
-
);
|
|
12
|
+
const { actions } =
|
|
13
|
+
yield import( '@wordpress/interactivity-router' );
|
|
15
14
|
yield actions.navigate( e.target.href );
|
|
16
15
|
state.clientSideNavigation = true;
|
|
17
16
|
},
|
|
18
17
|
*prefetch() {
|
|
19
18
|
const { ref } = getElement();
|
|
20
|
-
const { actions } =
|
|
21
|
-
'@wordpress/interactivity-router'
|
|
22
|
-
);
|
|
19
|
+
const { actions } =
|
|
20
|
+
yield import( '@wordpress/interactivity-router' );
|
|
23
21
|
yield actions.prefetch( ref.href );
|
|
24
22
|
},
|
|
25
23
|
pushName( name ) {
|
|
@@ -10,27 +10,24 @@ const { state } = store( 'test/router-styles', {
|
|
|
10
10
|
navigate: withSyncEvent( function* ( e ) {
|
|
11
11
|
e.preventDefault();
|
|
12
12
|
state.clientSideNavigation = false;
|
|
13
|
-
const { actions } =
|
|
14
|
-
'@wordpress/interactivity-router'
|
|
15
|
-
);
|
|
13
|
+
const { actions } =
|
|
14
|
+
yield import( '@wordpress/interactivity-router' );
|
|
16
15
|
yield actions.navigate( e.target.href );
|
|
17
16
|
state.clientSideNavigation = true;
|
|
18
17
|
} ),
|
|
19
18
|
navigateForce: withSyncEvent( function* ( e ) {
|
|
20
19
|
e.preventDefault();
|
|
21
20
|
state.clientSideNavigation = false;
|
|
22
|
-
const { actions } =
|
|
23
|
-
'@wordpress/interactivity-router'
|
|
24
|
-
);
|
|
21
|
+
const { actions } =
|
|
22
|
+
yield import( '@wordpress/interactivity-router' );
|
|
25
23
|
yield actions.navigate( e.target.href, { force: true } );
|
|
26
24
|
state.clientSideNavigation = true;
|
|
27
25
|
} ),
|
|
28
26
|
*prefetch() {
|
|
29
27
|
state.prefetching = true;
|
|
30
28
|
const { ref } = getElement();
|
|
31
|
-
const { actions } =
|
|
32
|
-
'@wordpress/interactivity-router'
|
|
33
|
-
);
|
|
29
|
+
const { actions } =
|
|
30
|
+
yield import( '@wordpress/interactivity-router' );
|
|
34
31
|
yield actions.prefetch( ref.href );
|
|
35
32
|
state.prefetching = false;
|
|
36
33
|
},
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { WebsocketProvider } from 'y-websocket';
|
|
11
|
+
import { setYjsModule } from './yjs-external';
|
|
11
12
|
|
|
12
13
|
const TEST_PROVIDER_NAMESPACE = 'gutenberg-test/rtc-websocket-provider';
|
|
13
14
|
const DEFAULT_URL = 'ws://127.0.0.1:18991';
|
|
@@ -37,7 +38,11 @@ function updateDebugState( room, patch ) {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
function createWebSocketProvider() {
|
|
40
|
-
return async ( { awareness, objectType, objectId, ydoc } ) => {
|
|
41
|
+
return async ( { awareness, objectType, objectId, ydoc, Y } ) => {
|
|
42
|
+
// Point the bundled y-websocket and y-protocols modules at the Yjs
|
|
43
|
+
// instance used by the editor. See yjs-external.js.
|
|
44
|
+
setYjsModule( Y );
|
|
45
|
+
|
|
41
46
|
const room = objectId ? `${ objectType }:${ objectId }` : objectType;
|
|
42
47
|
|
|
43
48
|
updateDebugState( room, {
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Shared-Yjs shim for the bundled y-websocket and y-protocols modules.
|
|
3
|
+
*
|
|
4
|
+
* The plugin build aliases the `yjs` module specifier to this file, so the
|
|
5
|
+
* bundled y-websocket and y-protocols modules resolve Yjs symbols here
|
|
6
|
+
* instead of bundling their own copy. Two Yjs instances on the same page
|
|
7
|
+
* cause silent data corruption: https://github.com/yjs/yjs/issues/438
|
|
6
8
|
*
|
|
7
9
|
* Only the symbols actually referenced by y-websocket and y-protocols
|
|
8
10
|
* need to be re-exported here.
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
export let Doc;
|
|
13
|
+
export let applyUpdate;
|
|
14
|
+
export let encodeStateAsUpdate;
|
|
15
|
+
export let encodeStateVector;
|
|
11
16
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const encodeStateVector = Y.encodeStateVector;
|
|
17
|
+
export function setYjsModule( Y ) {
|
|
18
|
+
( { Doc, applyUpdate, encodeStateAsUpdate, encodeStateVector } = Y );
|
|
19
|
+
}
|
|
@@ -40,7 +40,7 @@ function gutenberg_test_rtc_websocket_provider_enqueue() {
|
|
|
40
40
|
wp_enqueue_script(
|
|
41
41
|
'gutenberg-test-rtc-websocket-provider',
|
|
42
42
|
plugins_url( 'rtc-websocket-provider/build/index.js', __FILE__ ),
|
|
43
|
-
array( 'wp-hooks'
|
|
43
|
+
array( 'wp-hooks' ),
|
|
44
44
|
filemtime( $script_path ),
|
|
45
45
|
true
|
|
46
46
|
);
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Plugin Name: Gutenberg Test Starter Page Patterns
|
|
4
|
+
* Plugin URI: https://github.com/WordPress/gutenberg
|
|
5
|
+
* Author: Gutenberg Team
|
|
6
|
+
*
|
|
7
|
+
* @package gutenberg-test-starter-page-patterns
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
register_block_pattern_category(
|
|
11
|
+
'test-about',
|
|
12
|
+
array( 'label' => 'Test About' )
|
|
13
|
+
);
|
|
14
|
+
register_block_pattern_category(
|
|
15
|
+
'test-services',
|
|
16
|
+
array( 'label' => 'Test Services' )
|
|
17
|
+
);
|
|
18
|
+
register_block_pattern_category(
|
|
19
|
+
'test-post-only',
|
|
20
|
+
array( 'label' => 'Test Post Only' )
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
register_block_pattern(
|
|
24
|
+
'starter-page-patterns/about',
|
|
25
|
+
array(
|
|
26
|
+
'title' => 'About page',
|
|
27
|
+
'categories' => array( 'test-about' ),
|
|
28
|
+
'blockTypes' => array( 'core/post-content' ),
|
|
29
|
+
'postTypes' => array( 'page' ),
|
|
30
|
+
'content' => '<!-- wp:heading --><h2 class="wp-block-heading">About us</h2><!-- /wp:heading --><!-- wp:paragraph --><p>We build websites.</p><!-- /wp:paragraph -->',
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
register_block_pattern(
|
|
35
|
+
'starter-page-patterns/services',
|
|
36
|
+
array(
|
|
37
|
+
'title' => 'Services page',
|
|
38
|
+
'categories' => array( 'test-services' ),
|
|
39
|
+
'blockTypes' => array( 'core/post-content' ),
|
|
40
|
+
'postTypes' => array( 'page' ),
|
|
41
|
+
'content' => '<!-- wp:heading --><h2 class="wp-block-heading">Our services</h2><!-- /wp:heading -->',
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
register_block_pattern(
|
|
46
|
+
'starter-page-patterns/no-category',
|
|
47
|
+
array(
|
|
48
|
+
'title' => 'Plain page',
|
|
49
|
+
'blockTypes' => array( 'core/post-content' ),
|
|
50
|
+
'postTypes' => array( 'page' ),
|
|
51
|
+
'content' => '<!-- wp:paragraph --><p>A plain start.</p><!-- /wp:paragraph -->',
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
register_block_pattern(
|
|
56
|
+
'starter-page-patterns/post-only',
|
|
57
|
+
array(
|
|
58
|
+
'title' => 'Post call to action',
|
|
59
|
+
'categories' => array( 'test-post-only' ),
|
|
60
|
+
'blockTypes' => array( 'core/post-content' ),
|
|
61
|
+
'postTypes' => array( 'post' ),
|
|
62
|
+
'content' => '<!-- wp:paragraph --><p>Posts only.</p><!-- /wp:paragraph -->',
|
|
63
|
+
)
|
|
64
|
+
);
|