@wordpress/e2e-tests 7.29.0 → 8.0.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,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 8.0.0 (2024-05-31)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
10
+ - Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
11
+
5
12
  ## 7.29.0 (2024-05-16)
6
13
 
7
14
  ## 7.28.0 (2024-05-02)
@@ -64,7 +71,7 @@
64
71
 
65
72
  ### Breaking Changes
66
73
 
67
- - Started requiring Jest v29 instead of v27 as a peer dependency. See [breaking changes in Jest 28](https://jestjs.io/blog/2022/04/25/jest-28) and [in jest 29](https://jestjs.io/blog/2022/08/25/jest-29) ([#47388](https://github.com/WordPress/gutenberg/pull/47388))
74
+ - Started requiring Jest v29 instead of v27 as a peer dependency. See [breaking changes in Jest 28](https://jestjs.io/blog/2022/04/25/jest-28) and [in jest 29](https://jestjs.io/blog/2022/08/25/jest-29) ([#47388](https://github.com/WordPress/gutenberg/pull/47388))
68
75
 
69
76
  ## 6.5.0 (2023-03-01)
70
77
 
package/README.md CHANGED
@@ -80,7 +80,7 @@ Debugging in a Chrome browser can be replaced with `vscode`'s debugger by adding
80
80
 
81
81
  This will run jest, targetting the spec file currently open in the editor. `vscode`'s debugger can now be used to add breakpoints and inspect tests as you would in Chrome DevTools.
82
82
 
83
- **Note**: This package requires Node.js 14.0.0 or later. It is not compatible with older versions.
83
+ **Note**: This package requires Node.js version with long-term support status (check [Active LTS or Maintenance LTS releases](https://nodejs.org/en/about/previous-releases)). It is not compatible with older versions.
84
84
 
85
85
  ## Contributing to this package
86
86
 
@@ -1,6 +1,3 @@
1
- global.process.env = {
2
- ...global.process.env,
3
- // Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
4
- // eslint-disable-next-line @wordpress/is-gutenberg-plugin
5
- IS_GUTENBERG_PLUGIN: process.env.npm_package_config_IS_GUTENBERG_PLUGIN,
6
- };
1
+ // eslint-disable-next-line @wordpress/wp-global-usage
2
+ globalThis.IS_GUTENBERG_PLUGIN =
3
+ process.env.npm_package_config_IS_GUTENBERG_PLUGIN === 'true';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "7.29.0",
3
+ "version": "8.0.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",
@@ -20,16 +20,17 @@
20
20
  "url": "https://github.com/WordPress/gutenberg/issues"
21
21
  },
22
22
  "engines": {
23
- "node": ">=14"
23
+ "node": ">=18.12.0",
24
+ "npm": ">=8.19.2"
24
25
  },
25
26
  "dependencies": {
26
- "@wordpress/e2e-test-utils": "^10.29.0",
27
- "@wordpress/interactivity": "^5.7.0",
28
- "@wordpress/interactivity-router": "^1.8.0",
29
- "@wordpress/jest-console": "^7.29.0",
30
- "@wordpress/jest-puppeteer-axe": "^6.29.0",
31
- "@wordpress/scripts": "^27.9.0",
32
- "@wordpress/url": "^3.59.0",
27
+ "@wordpress/e2e-test-utils": "^11.0.0",
28
+ "@wordpress/interactivity": "^6.0.0",
29
+ "@wordpress/interactivity-router": "^2.0.0",
30
+ "@wordpress/jest-console": "^8.0.0",
31
+ "@wordpress/jest-puppeteer-axe": "^7.0.0",
32
+ "@wordpress/scripts": "^28.0.0",
33
+ "@wordpress/url": "^4.0.0",
33
34
  "chalk": "^4.0.0",
34
35
  "expect-puppeteer": "^4.4.0",
35
36
  "filenamify": "^4.2.0",
@@ -46,5 +47,5 @@
46
47
  "publishConfig": {
47
48
  "access": "public"
48
49
  },
49
- "gitHead": "42f38f287506a6b3ed8ccba839b18ad066821044"
50
+ "gitHead": "2f30cddff15723ac7017fd009fc5913b7b419400"
50
51
  }
@@ -17,7 +17,6 @@
17
17
  {
18
18
  className: 'e2e-reset-block-button',
19
19
  variant: "secondary",
20
- isLarge: true,
21
20
  onClick() {
22
21
  const emptyBlock = createBlock( props.name );
23
22
  props.onReplace( emptyBlock );
@@ -92,7 +92,7 @@
92
92
 
93
93
  edit: function InnerBlocksUpdateLockedTemplateEdit( props ) {
94
94
  const hasUpdatedTemplated = props.attributes.hasUpdatedTemplate;
95
- return el( 'div', null, [
95
+ return el( 'div', null,
96
96
  el(
97
97
  'button',
98
98
  {
@@ -108,7 +108,7 @@
108
108
  : TEMPLATE,
109
109
  templateLock: 'all',
110
110
  } ) ),
111
- ] );
111
+ );
112
112
  },
113
113
 
114
114
  save,
@@ -18,6 +18,28 @@
18
18
  <a data-wp-bind--href="state.url" data-testid="object namespace"></a>
19
19
  </div>
20
20
 
21
+ <div data-wp-interactive="null">
22
+ <a data-wp-bind--href="state.url" data-testid="null namespace"></a>
23
+ </div>
24
+
25
+ <div data-wp-interactive="2">
26
+ <a data-wp-bind--href="state.url" data-testid="number namespace"></a>
27
+ </div>
28
+
21
29
  <div data-wp-interactive>
22
30
  <a data-wp-bind--href="other::state.url" data-testid="other namespace"></a>
23
31
  </div>
32
+
33
+ <div data-wp-interactive="true">
34
+ <a data-wp-bind--href="state.url" data-testid="true namespace"></a>
35
+ </div>
36
+
37
+ <div data-wp-interactive="false">
38
+ <a data-wp-bind--href="state.url" data-testid="false namespace"></a>
39
+ </div>
40
+ <div data-wp-interactive="[]">
41
+ <a data-wp-bind--href="state.url" data-testid="[] namespace"></a>
42
+ </div>
43
+ <div data-wp-interactive='"quoted string"'>
44
+ <a data-wp-bind--href="state.url" data-testid="quoted namespace"></a>
45
+ </div>
@@ -3,9 +3,16 @@
3
3
  */
4
4
  import { store } from '@wordpress/interactivity';
5
5
 
6
+
7
+ store( '', {
8
+ state: {
9
+ url: '/empty-string-url',
10
+ },
11
+ } );
12
+
6
13
  store( 'namespace', {
7
14
  state: {
8
- url: '/some-url',
15
+ url: '/namespace-url',
9
16
  },
10
17
  } );
11
18
 
@@ -14,3 +21,50 @@ store( 'other', {
14
21
  url: '/other-store-url',
15
22
  },
16
23
  } );
24
+
25
+ store( 'null', {
26
+ state: {
27
+ url: '/null-url',
28
+ },
29
+ } );
30
+
31
+ store( '2', {
32
+ state: {
33
+ url: '/number-url',
34
+ },
35
+ } );
36
+
37
+ store( '{}', {
38
+ state: {
39
+ url: '/object-url',
40
+ },
41
+ } );
42
+
43
+ store( 'true', {
44
+ state: {
45
+ url: '/true-url',
46
+ },
47
+ } );
48
+
49
+ store( 'false', {
50
+ state: {
51
+ url: '/false-url',
52
+ },
53
+ } );
54
+
55
+ store( '[]', {
56
+ state: {
57
+ url: '/array-url',
58
+ },
59
+ } );
60
+
61
+ store( '"quoted string"', {
62
+ state: {
63
+ url: '/quoted-url',
64
+ },
65
+ } );
66
+
67
+
68
+
69
+
70
+
@@ -29,11 +29,7 @@ add_action(
29
29
  // Ensure the interactivity API is loaded.
30
30
  wp_interactivity();
31
31
  // But remove the server directive processing.
32
- remove_filter(
33
- 'render_block_data',
34
- 'wp_interactivity_process_directives_of_interactive_blocks',
35
- 100
36
- );
32
+ add_filter( 'interactivity_process_directives', '__return_false' );
37
33
  }
38
34
  }
39
35
  );