@wordpress/e2e-tests 8.9.0 → 8.10.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
+ ## 8.10.0 (2024-10-16)
6
+
5
7
  ## 8.9.0 (2024-10-03)
6
8
 
7
9
  ## 8.8.0 (2024-09-19)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "8.9.0",
3
+ "version": "8.10.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.9.0",
28
- "@wordpress/interactivity": "^6.9.0",
29
- "@wordpress/interactivity-router": "^2.9.0",
30
- "@wordpress/jest-console": "^8.9.0",
31
- "@wordpress/jest-puppeteer-axe": "^7.9.0",
32
- "@wordpress/scripts": "^30.1.0",
33
- "@wordpress/url": "^4.9.0",
27
+ "@wordpress/e2e-test-utils": "^11.10.0",
28
+ "@wordpress/interactivity": "^6.10.0",
29
+ "@wordpress/interactivity-router": "^2.10.0",
30
+ "@wordpress/jest-console": "^8.10.0",
31
+ "@wordpress/jest-puppeteer-axe": "^7.10.0",
32
+ "@wordpress/scripts": "^30.2.0",
33
+ "@wordpress/url": "^4.10.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": "2e5495c635910cb34bfaca3c6258d2e989f66214"
50
+ "gitHead": "ab34a7ac935fd1478eac63b596242d83270897ee"
51
51
  }
@@ -19,7 +19,6 @@ const setValues = ( { dispatch, bindings } ) => {
19
19
 
20
20
  registerBlockBindingsSource( {
21
21
  name: 'testing/complete-source',
22
- label: 'Complete Source',
23
22
  getValues,
24
23
  setValues,
25
24
  canUserEditValue: () => true,
@@ -11,7 +11,7 @@ add_action(
11
11
  'init',
12
12
  function () {
13
13
  // Custom template used by most tests.
14
- wp_register_block_template(
14
+ register_block_template(
15
15
  'gutenberg//plugin-template',
16
16
  array(
17
17
  'title' => 'Plugin Template',
@@ -28,7 +28,7 @@ add_action(
28
28
  );
29
29
 
30
30
  // Custom template overridden by the theme.
31
- wp_register_block_template(
31
+ register_block_template(
32
32
  'gutenberg//custom-template',
33
33
  array(
34
34
  'title' => 'Custom Template (overridden by the theme)',
@@ -39,7 +39,7 @@ add_action(
39
39
  );
40
40
 
41
41
  // Custom template used to test unregistration.
42
- wp_register_block_template(
42
+ register_block_template(
43
43
  'gutenberg//plugin-unregistered-template',
44
44
  array(
45
45
  'title' => 'Plugin Unregistered Template',
@@ -47,10 +47,10 @@ add_action(
47
47
  'content' => '<!-- wp:template-part {"slug":"header","tagName":"header"} /--><!-- wp:group {"tagName":"main","layout":{"inherit":true}} --><main class="wp-block-group"><!-- wp:paragraph --><p>This is a plugin-registered template that is also unregistered.</p><!-- /wp:paragraph --></main><!-- /wp:group -->',
48
48
  )
49
49
  );
50
- wp_unregister_block_template( 'gutenberg//plugin-unregistered-template' );
50
+ unregister_block_template( 'gutenberg//plugin-unregistered-template' );
51
51
 
52
52
  // Custom template used to test overriding default WP templates.
53
- wp_register_block_template(
53
+ register_block_template(
54
54
  'gutenberg//page',
55
55
  array(
56
56
  'title' => 'Plugin Page Template',
@@ -60,7 +60,7 @@ add_action(
60
60
  );
61
61
 
62
62
  // Custom template used to test overriding default WP templates which can be created by the user.
63
- wp_register_block_template(
63
+ register_block_template(
64
64
  'gutenberg//author-admin',
65
65
  array(
66
66
  'title' => 'Plugin Author Template',
@@ -59,17 +59,17 @@
59
59
  data-testid="can toggle class when class attribute is missing"
60
60
  ></div>
61
61
 
62
- <div data-wp-context='{ "falseValue": false }'>
62
+ <div data-wp-context='{ "value": false }'>
63
63
  <div
64
64
  class="foo"
65
- data-wp-class--foo="context.falseValue"
65
+ data-wp-class--foo="context.value"
66
66
  data-testid="can use context values"
67
67
  ></div>
68
68
  <button
69
- data-wp-on--click="actions.toggleContextFalseValue"
69
+ data-wp-on--click="actions.toggleContextValue"
70
70
  data-testid="toggle context false value"
71
71
  >
72
- Toggle context falseValue
72
+ Toggle context value
73
73
  </button>
74
74
  </div>
75
75
 
@@ -83,4 +83,16 @@
83
83
  data-testid="can use classes with several dashes"
84
84
  ></div>
85
85
 
86
+ <div data-wp-context='{ "value": false }'>
87
+ <div
88
+ data-wp-class--default="context.value"
89
+ data-testid="class name default"
90
+ ></div>
91
+ <button
92
+ data-wp-on--click="actions.toggleContextValue"
93
+ data-testid="toggle class name default"
94
+ >
95
+ Toggle context val
96
+ </button>
97
+ </div>
86
98
  </div>
@@ -15,9 +15,9 @@ const { state } = store( 'directive-class', {
15
15
  toggleFalseValue: () => {
16
16
  state.falseValue = ! state.falseValue;
17
17
  },
18
- toggleContextFalseValue: () => {
18
+ toggleContextValue: () => {
19
19
  const context = getContext();
20
- context.falseValue = ! context.falseValue;
20
+ context.value = ! context.value;
21
21
  },
22
22
  },
23
23
  } );
@@ -12,7 +12,7 @@ const { directive } = privateApis(
12
12
  directive(
13
13
  'show-mock',
14
14
  ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
15
- const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
15
+ const entry = showMock.find( ( { suffix } ) => suffix === null );
16
16
  if ( ! evaluate( entry ) ) {
17
17
  return null;
18
18
  }
@@ -12,7 +12,7 @@ const { directive } = privateApis(
12
12
  directive(
13
13
  'show-mock',
14
14
  ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
15
- const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
15
+ const entry = showMock.find( ( { suffix } ) => suffix === null );
16
16
  if ( ! evaluate( entry ) ) {
17
17
  return null;
18
18
  }
@@ -12,7 +12,7 @@ const { directive } = privateApis(
12
12
  directive(
13
13
  'show-mock',
14
14
  ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
15
- const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
15
+ const entry = showMock.find( ( { suffix } ) => suffix === null );
16
16
  if ( ! evaluate( entry ) ) {
17
17
  return null;
18
18
  }
@@ -21,9 +21,7 @@ directive(
21
21
  element,
22
22
  evaluate,
23
23
  } ) => {
24
- const entry = showChildren.find(
25
- ( { suffix } ) => suffix === 'default'
26
- );
24
+ const entry = showChildren.find( ( { suffix } ) => suffix === null );
27
25
  return evaluate( entry )
28
26
  ? element
29
27
  : cloneElement( element, { children: null } );
@@ -12,7 +12,7 @@ const { directive } = privateApis(
12
12
  directive(
13
13
  'show-mock',
14
14
  ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
15
- const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
15
+ const entry = showMock.find( ( { suffix } ) => suffix === null );
16
16
  if ( ! evaluate( entry ) ) {
17
17
  return null;
18
18
  }
@@ -12,7 +12,7 @@ const { directive, h } = privateApis(
12
12
  directive(
13
13
  'show-mock',
14
14
  ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
15
- const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
15
+ const entry = showMock.find( ( { suffix } ) => suffix === null );
16
16
 
17
17
  if ( ! evaluate( entry ) ) {
18
18
  element.props.children = h(