@wordpress/e2e-tests 9.7.0 → 9.8.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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 9.8.0 (2026-04-01)
6
+
5
7
  ## 9.7.0 (2026-03-18)
6
8
 
7
9
  ## 9.6.0 (2026-03-04)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "9.7.0",
3
+ "version": "9.8.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.42.0",
28
- "@wordpress/interactivity-router": "^2.42.0"
27
+ "@wordpress/interactivity": "^6.43.0",
28
+ "@wordpress/interactivity-router": "^2.43.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "jest": ">=29",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "c20787b1778ae64c2db65643b1c236309d68e6ba"
39
+ "gitHead": "2cea90674d11aa521ec3f71652fb3a6a4c383969"
40
40
  }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Script module that demonstrates client-side connector registration.
3
+ *
4
+ * The server registers test_custom_service with its name and description.
5
+ * This module calls registerConnector() with the same slug to add a render
6
+ * function. The store merges both registrations, so the final connector
7
+ * combines the render function from JS with the metadata from PHP.
8
+ */
9
+
10
+ // eslint-disable-next-line import/no-extraneous-dependencies
11
+ import {
12
+ __experimentalRegisterConnector as registerConnector,
13
+ __experimentalConnectorItem as ConnectorItem,
14
+ } from '@wordpress/connectors';
15
+
16
+ const h = window.React.createElement;
17
+
18
+ // Register the render function for the connector.
19
+ registerConnector( 'test_custom_service', {
20
+ render: ( props ) =>
21
+ h(
22
+ ConnectorItem,
23
+ {
24
+ className: 'connector-item--test_custom_service',
25
+ name: props.name,
26
+ description: props.description,
27
+ logo: props.logo,
28
+ },
29
+ h(
30
+ 'p',
31
+ { className: 'test-custom-service-content' },
32
+ 'Custom rendered content for testing.'
33
+ )
34
+ ),
35
+ } );
@@ -0,0 +1,68 @@
1
+ <?php
2
+ /**
3
+ * Plugin Name: Gutenberg Test Connectors JS Extensibility
4
+ * Plugin URI: https://github.com/WordPress/gutenberg
5
+ * Author: Gutenberg Team
6
+ *
7
+ * Registers two custom-type connectors on the server:
8
+ *
9
+ * 1. test_custom_service — also registered client-side via a script module using
10
+ * the merging strategy (two registerConnector calls with the same slug: one
11
+ * providing the render function, the other metadata).
12
+ * 2. test_server_only_service — server-only, with no client-side render function,
13
+ * so it should not display a card in the UI.
14
+ *
15
+ * @package gutenberg-test-connectors-js-extensibility
16
+ */
17
+
18
+ // Register two custom-type connectors for E2E testing.
19
+ add_action(
20
+ 'wp_connectors_init',
21
+ static function ( WP_Connector_Registry $registry ) {
22
+ $registry->register(
23
+ 'test_custom_service',
24
+ array(
25
+ 'name' => 'Test Custom Service',
26
+ 'description' => 'A custom service for E2E testing.',
27
+ 'type' => 'custom_service',
28
+ 'authentication' => array(
29
+ 'method' => 'none',
30
+ ),
31
+ )
32
+ );
33
+
34
+ $registry->register(
35
+ 'test_server_only_service',
36
+ array(
37
+ 'name' => 'Test Server Only Service',
38
+ 'description' => 'A server-only service with no JS render.',
39
+ 'type' => 'custom_service',
40
+ 'authentication' => array(
41
+ 'method' => 'none',
42
+ ),
43
+ )
44
+ );
45
+ }
46
+ );
47
+
48
+ // Enqueue the script module on the connectors page.
49
+ add_action(
50
+ 'admin_enqueue_scripts',
51
+ static function () {
52
+ if ( ! isset( $_GET['page'] ) || 'options-connectors-wp-admin' !== $_GET['page'] ) {
53
+ return;
54
+ }
55
+
56
+ wp_register_script_module(
57
+ 'gutenberg-test-connectors-js-extensibility',
58
+ plugins_url( 'connectors-js-extensibility/index.mjs', __FILE__ ),
59
+ array(
60
+ array(
61
+ 'id' => '@wordpress/connectors',
62
+ 'import' => 'static',
63
+ ),
64
+ )
65
+ );
66
+ wp_enqueue_script_module( 'gutenberg-test-connectors-js-extensibility' );
67
+ }
68
+ );