@wordpress/e2e-tests 8.31.0 → 8.31.1-next.233ccab9b.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.
Files changed (39) hide show
  1. package/package.json +9 -9
  2. package/plugins/interactive-blocks/deferred-store/block.json +1 -1
  3. package/plugins/interactive-blocks/directive-bind/block.json +1 -1
  4. package/plugins/interactive-blocks/directive-class/block.json +1 -1
  5. package/plugins/interactive-blocks/directive-context/block.json +1 -1
  6. package/plugins/interactive-blocks/directive-context/render.php +8 -0
  7. package/plugins/interactive-blocks/directive-context/view.js +17 -1
  8. package/plugins/interactive-blocks/directive-each/block.json +1 -1
  9. package/plugins/interactive-blocks/directive-each/render.php +12 -0
  10. package/plugins/interactive-blocks/directive-init/block.json +1 -1
  11. package/plugins/interactive-blocks/directive-key/block.json +1 -1
  12. package/plugins/interactive-blocks/directive-on/block.json +1 -1
  13. package/plugins/interactive-blocks/directive-on-document/block.json +1 -1
  14. package/plugins/interactive-blocks/directive-on-window/block.json +1 -1
  15. package/plugins/interactive-blocks/directive-priorities/block.json +1 -1
  16. package/plugins/interactive-blocks/directive-run/block.json +1 -1
  17. package/plugins/interactive-blocks/directive-style/block.json +1 -1
  18. package/plugins/interactive-blocks/directive-text/block.json +1 -1
  19. package/plugins/interactive-blocks/directive-watch/block.json +1 -1
  20. package/plugins/interactive-blocks/generator-scope/block.json +1 -1
  21. package/plugins/interactive-blocks/get-server-context/block.json +1 -1
  22. package/plugins/interactive-blocks/get-server-state/block.json +1 -1
  23. package/plugins/interactive-blocks/namespace/block.json +1 -1
  24. package/plugins/interactive-blocks/negation-operator/block.json +1 -1
  25. package/plugins/interactive-blocks/router-navigate/block.json +1 -1
  26. package/plugins/interactive-blocks/router-regions/block.json +1 -1
  27. package/plugins/interactive-blocks/router-script-modules-alpha/block.json +1 -1
  28. package/plugins/interactive-blocks/router-script-modules-bravo/block.json +1 -1
  29. package/plugins/interactive-blocks/router-script-modules-charlie/block.json +1 -1
  30. package/plugins/interactive-blocks/router-script-modules-wrapper/block.json +1 -1
  31. package/plugins/interactive-blocks/router-styles-blue/block.json +1 -1
  32. package/plugins/interactive-blocks/router-styles-green/block.json +1 -1
  33. package/plugins/interactive-blocks/router-styles-red/block.json +1 -1
  34. package/plugins/interactive-blocks/router-styles-wrapper/block.json +1 -1
  35. package/plugins/interactive-blocks/store/block.json +1 -1
  36. package/plugins/interactive-blocks/store-tag/block.json +1 -1
  37. package/plugins/interactive-blocks/tovdom/block.json +1 -1
  38. package/plugins/interactive-blocks/tovdom-islands/block.json +1 -1
  39. package/plugins/interactive-blocks/with-scope/block.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "8.31.0",
3
+ "version": "8.31.1-next.233ccab9b.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.31.0",
28
- "@wordpress/interactivity": "^6.31.0",
29
- "@wordpress/interactivity-router": "^2.31.0",
30
- "@wordpress/jest-console": "^8.31.0",
31
- "@wordpress/jest-puppeteer-axe": "^7.31.0",
32
- "@wordpress/scripts": "^30.24.0",
33
- "@wordpress/url": "^4.31.0",
27
+ "@wordpress/e2e-test-utils": "^11.31.1-next.233ccab9b.0",
28
+ "@wordpress/interactivity": "^6.31.1-next.233ccab9b.0",
29
+ "@wordpress/interactivity-router": "^2.31.1-next.233ccab9b.0",
30
+ "@wordpress/jest-console": "^8.31.1-next.233ccab9b.0",
31
+ "@wordpress/jest-puppeteer-axe": "^7.31.1-next.233ccab9b.0",
32
+ "@wordpress/scripts": "^30.24.1-next.233ccab9b.0",
33
+ "@wordpress/url": "^4.31.1-next.233ccab9b.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": "d7601d30d49462ea942168e8ab6bf449fb93097e"
50
+ "gitHead": "d11f971521e4b39b07124d5c5516890ff98b0e31"
51
51
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/deferred-store",
5
5
  "title": "E2E Interactivity tests - deferred store",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-bind",
5
5
  "title": "E2E Interactivity tests - directive bind",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-class",
5
5
  "title": "E2E Interactivity tests - directive class",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-context",
5
5
  "title": "E2E Interactivity tests - directive context",
6
6
  "category": "text",
@@ -166,6 +166,14 @@
166
166
  <button data-testid="async navigate" data-wp-on--click="actions.asyncNavigate">Async Navigate</button>
167
167
  </div>
168
168
 
169
+ <!-- Count of succesfull client-side navigations -->
170
+ <div
171
+ data-testid="navigation count"
172
+ data-wp-interactive="directive-context-navigate"
173
+ data-wp-watch="callbacks.updateNavigationCount"
174
+ data-wp-text="state.navigationCount"
175
+ ></div>
176
+
169
177
  <div
170
178
  data-wp-interactive='{"namespace": "directive-context-non-default"}'
171
179
  data-wp-context--non-default='{ "text": "non default" }'
@@ -70,7 +70,14 @@ const html = `
70
70
  <button data-testid="async navigate" data-wp-on--click="actions.asyncNavigate">Async Navigate</button>
71
71
  </div>`;
72
72
 
73
- const { actions } = store( 'directive-context-navigate', {
73
+ const { actions, state } = store( 'directive-context-navigate', {
74
+ state: {
75
+ get navigationCount() {
76
+ const { __navigationCount } = state;
77
+ return isNaN( __navigationCount ) ? 0 : __navigationCount;
78
+ },
79
+ __navigationCount: NaN,
80
+ },
74
81
  actions: {
75
82
  toggleText() {
76
83
  const ctx = getContext();
@@ -99,6 +106,15 @@ const { actions } = store( 'directive-context-navigate', {
99
106
  ctx.newText = 'changed from async action';
100
107
  },
101
108
  },
109
+ callbacks: {
110
+ updateNavigationCount() {
111
+ const { state: routerState } = store( 'core/router' );
112
+ if ( routerState.url && isNaN( state.__navigationCount ) ) {
113
+ state.__navigationCount = 0;
114
+ }
115
+ state.__navigationCount++;
116
+ },
117
+ },
102
118
  } );
103
119
 
104
120
  store( 'directive-context-watch', {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-each",
5
5
  "title": "E2E Interactivity tests - directive each",
6
6
  "category": "text",
@@ -311,3 +311,15 @@
311
311
  >
312
312
  <template data-wp-each="state.eachIterator"><p data-wp-text="context.item"></p></template>
313
313
  </div>
314
+
315
+ <ul
316
+ data-wp-interactive="directive-each"
317
+ data-testid="nested-with-same-item-key"
318
+ >
319
+ <template data-wp-each="context.list" data-wp-context='{"list":["parent1","parent2"]}'>
320
+ <template data-wp-each="context.list" data-wp-context='{"list":["child1","child2"]}'>
321
+ <li data-wp-text="context.item"></li>
322
+ </template>
323
+ <li data-wp-text="context.item"></li>
324
+ </template>
325
+ </ul>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-init",
5
5
  "title": "E2E Interactivity tests - directive init",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-key",
5
5
  "title": "E2E Interactivity tests - directive key",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-on",
5
5
  "title": "E2E Interactivity tests - directive on",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-on-document",
5
5
  "title": "E2E Interactivity tests - directive on document",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-on-window",
5
5
  "title": "E2E Interactivity tests - directive on window",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-priorities",
5
5
  "title": "E2E Interactivity tests - directive priorities",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-run",
5
5
  "title": "E2E Interactivity tests - directive run",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-style",
5
5
  "title": "E2E Interactivity tests - directive style",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-text",
5
5
  "title": "E2E Interactivity tests - directive text",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/directive-watch",
5
5
  "title": "E2E Interactivity tests - directive watch",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/generator-scope",
5
5
  "title": "E2E Interactivity tests - generator scope",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/get-server-context",
5
5
  "title": "E2E Interactivity tests - getServerContext",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/get-server-state",
5
5
  "title": "E2E Interactivity tests - getServerState",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test-namespace/directive-bind",
5
5
  "title": "E2E Interactivity tests - directive bind",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/negation-operator",
5
5
  "title": "E2E Interactivity tests - negation operator",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-navigate",
5
5
  "title": "E2E Interactivity tests - router navigate",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-regions",
5
5
  "title": "E2E Interactivity tests - router regions",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-script-modules-alpha",
5
5
  "title": "E2E Interactivity tests - router modules - Alpha",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-script-modules-bravo",
5
5
  "title": "E2E Interactivity tests - router modules - Bravo",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-script-modules-charlie",
5
5
  "title": "E2E Interactivity tests - router modules - Charlie",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-script-modules-wrapper",
5
5
  "title": "E2E Interactivity tests - router modules - Wrapper",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-styles-blue",
5
5
  "title": "E2E Interactivity tests - router styles - Blue",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-styles-green",
5
5
  "title": "E2E Interactivity tests - router styles - Green",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-styles-red",
5
5
  "title": "E2E Interactivity tests - router styles - Red",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/router-styles-wrapper",
5
5
  "title": "E2E Interactivity tests - router styles - Wrapper",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/store",
5
5
  "title": "E2E Interactivity tests - store definition",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/store-tag",
5
5
  "title": "E2E Interactivity tests - store tag",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/tovdom",
5
5
  "title": "E2E Interactivity tests - tovdom",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/tovdom-islands",
5
5
  "title": "E2E Interactivity tests - tovdom islands",
6
6
  "category": "text",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://schemas.wp.org/trunk/block.json",
3
- "apiVersion": 2,
3
+ "apiVersion": 3,
4
4
  "name": "test/with-scope",
5
5
  "title": "E2E Interactivity tests - with scope",
6
6
  "category": "text",