@wordpress/e2e-tests 7.17.0 → 7.18.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 (57) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/package.json +8 -7
  3. package/plugins/block-icons/index.js +1 -1
  4. package/plugins/dataviews.php +25 -0
  5. package/plugins/interactive-blocks/directive-bind/render.php +3 -1
  6. package/plugins/interactive-blocks/directive-bind/view.js +32 -29
  7. package/plugins/interactive-blocks/directive-body/render.php +3 -1
  8. package/plugins/interactive-blocks/directive-body/view.js +11 -9
  9. package/plugins/interactive-blocks/directive-class/render.php +3 -1
  10. package/plugins/interactive-blocks/directive-class/view.js +20 -18
  11. package/plugins/interactive-blocks/directive-context/render.php +6 -4
  12. package/plugins/interactive-blocks/directive-context/view.js +49 -40
  13. package/plugins/interactive-blocks/directive-init/render.php +8 -6
  14. package/plugins/interactive-blocks/directive-init/view.js +59 -60
  15. package/plugins/interactive-blocks/directive-key/render.php +5 -1
  16. package/plugins/interactive-blocks/directive-key/view.js +18 -14
  17. package/plugins/interactive-blocks/directive-on/render.php +3 -1
  18. package/plugins/interactive-blocks/directive-on/view.js +27 -24
  19. package/plugins/interactive-blocks/directive-priorities/render.php +7 -2
  20. package/plugins/interactive-blocks/directive-priorities/view.js +107 -111
  21. package/plugins/interactive-blocks/directive-slots/render.php +3 -1
  22. package/plugins/interactive-blocks/directive-slots/view.js +17 -15
  23. package/plugins/interactive-blocks/directive-style/render.php +2 -1
  24. package/plugins/interactive-blocks/directive-style/view.js +21 -19
  25. package/plugins/interactive-blocks/directive-text/render.php +3 -1
  26. package/plugins/interactive-blocks/directive-text/view.js +16 -14
  27. package/plugins/interactive-blocks/{store-afterload → directive-watch}/block.json +3 -3
  28. package/plugins/interactive-blocks/{directive-effect → directive-watch}/render.php +8 -6
  29. package/plugins/interactive-blocks/directive-watch/view.js +53 -0
  30. package/plugins/interactive-blocks/negation-operator/render.php +4 -2
  31. package/plugins/interactive-blocks/negation-operator/view.js +15 -19
  32. package/plugins/interactive-blocks/router-navigate/render.php +11 -8
  33. package/plugins/interactive-blocks/router-navigate/view.js +27 -34
  34. package/plugins/interactive-blocks/router-regions/render.php +13 -3
  35. package/plugins/interactive-blocks/router-regions/view.js +37 -35
  36. package/plugins/interactive-blocks/store-tag/render.php +7 -4
  37. package/plugins/interactive-blocks/store-tag/view.js +19 -19
  38. package/plugins/interactive-blocks/tovdom/render.php +3 -1
  39. package/plugins/interactive-blocks/tovdom/view.js +5 -4
  40. package/plugins/interactive-blocks/tovdom-islands/render.php +11 -6
  41. package/plugins/interactive-blocks/tovdom-islands/view.js +24 -23
  42. package/plugins/interactive-blocks.php +2 -2
  43. package/specs/editor/various/datepicker.test.js +8 -8
  44. package/specs/editor/various/pattern-blocks.test.js +4 -4
  45. package/specs/editor/various/scheduling.test.js +1 -1
  46. package/plugins/interactive-blocks/directive-effect/block.json +0 -14
  47. package/plugins/interactive-blocks/directive-effect/view.js +0 -59
  48. package/plugins/interactive-blocks/store-afterload/render.php +0 -41
  49. package/plugins/interactive-blocks/store-afterload/view.js +0 -60
  50. package/specs/editor/plugins/__snapshots__/align-hook.test.js.snap +0 -43
  51. package/specs/editor/plugins/__snapshots__/block-directory-add.test.js.snap +0 -3
  52. package/specs/editor/plugins/align-hook.test.js +0 -234
  53. package/specs/editor/plugins/block-directory-add.test.js +0 -205
  54. package/specs/editor/plugins/block-icons.test.js +0 -170
  55. package/specs/editor/plugins/custom-taxonomies.test.js +0 -61
  56. package/specs/editor/various/is-typing.test.js +0 -101
  57. package/specs/editor/various/sidebar-permalink.test.js +0 -53
@@ -6,26 +6,29 @@
6
6
  * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
7
7
  */
8
8
 
9
+ gutenberg_enqueue_module( 'router-navigate-view' );
9
10
  ?>
10
11
 
11
-
12
- <div data-wp-interactive data-wp-navigation-id="region-1">
12
+ <div
13
+ data-wp-interactive='{ "namespace": "router" }'
14
+ data-wp-navigation-id="region-1"
15
+ >
13
16
  <h2 data-testid="title"><?php echo $attributes['title']; ?></h2>
14
17
 
15
18
  <output
16
19
  data-testid="router navigations"
17
- data-wp-text="state.router.navigations"
20
+ data-wp-text="state.navigations"
18
21
  >NaN</output>
19
22
  <output
20
23
  data-testid="router status"
21
- data-wp-text="state.router.status"
24
+ data-wp-text="state.status"
22
25
  >undefined</output>
23
26
 
24
27
  <button
25
- data-wp-on--click="actions.router.toggleTimeout"
28
+ data-wp-on--click="actions.toggleTimeout"
26
29
  data-testid="toggle timeout"
27
30
  >
28
- Timeout <span data-wp-text="state.router.timeout">NaN</span>
31
+ Timeout <span data-wp-text="state.timeout">NaN</span>
29
32
  </button>
30
33
 
31
34
  <?php
@@ -35,12 +38,12 @@
35
38
  echo <<<HTML
36
39
  <a
37
40
  data-testid="link $i"
38
- data-wp-on--click="actions.router.navigate"
41
+ data-wp-on--click="actions.navigate"
39
42
  href="$link"
40
43
  >link $i</a>
41
44
  <a
42
45
  data-testid="link $i with hash"
43
- data-wp-on--click="actions.router.navigate"
46
+ data-wp-on--click="actions.navigate"
44
47
  data-force-navigation="true"
45
48
  href="$link#link-$i-with-hash"
46
49
  >link $i with hash</a>
@@ -1,41 +1,34 @@
1
- ( ( { wp } ) => {
2
- /**
3
- * WordPress dependencies
4
- */
5
- const { store, navigate } = wp.interactivity;
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store, navigate } from '@wordpress/interactivity';
6
5
 
7
- store( {
8
- state: {
9
- router: {
10
- status: 'idle',
11
- navigations: 0,
12
- timeout: 10000,
13
- }
14
- },
15
- actions: {
16
- router: {
17
- navigate: async ( { state, event: e } ) => {
18
- e.preventDefault();
6
+ const { state } = store( 'router', {
7
+ state: {
8
+ status: 'idle',
9
+ navigations: 0,
10
+ timeout: 10000,
11
+ },
12
+ actions: {
13
+ *navigate( e ) {
14
+ e.preventDefault();
19
15
 
20
- state.router.navigations += 1;
21
- state.router.status = 'busy';
16
+ state.navigations += 1;
17
+ state.status = 'busy';
22
18
 
23
- const force = e.target.dataset.forceNavigation === 'true';
24
- const { timeout } = state.router;
19
+ const force = e.target.dataset.forceNavigation === 'true';
20
+ const { timeout } = state;
25
21
 
26
- await navigate( e.target.href, { force, timeout } );
22
+ yield navigate( e.target.href, { force, timeout } );
27
23
 
28
- state.router.navigations -= 1;
24
+ state.navigations -= 1;
29
25
 
30
- if ( state.router.navigations === 0) {
31
- state.router.status = 'idle';
32
- }
33
- },
34
- toggleTimeout: ( { state }) => {
35
- state.router.timeout =
36
- state.router.timeout === 10000 ? 0 : 10000;
37
- }
38
- },
26
+ if ( state.navigations === 0 ) {
27
+ state.status = 'idle';
28
+ }
29
+ },
30
+ toggleTimeout() {
31
+ state.timeout = state.timeout === 10000 ? 0 : 10000;
39
32
  },
40
- } );
41
- } )( window );
33
+ },
34
+ } );
@@ -6,11 +6,15 @@
6
6
  * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
7
7
  */
8
8
 
9
+ gutenberg_enqueue_module( 'router-regions-view' );
9
10
  ?>
10
11
 
11
12
  <section>
12
13
  <h2>Region 1</h2>
13
- <div data-wp-interactive data-wp-navigation-id="region-1">
14
+ <div
15
+ data-wp-interactive='{"namespace": "router-regions"}'
16
+ data-wp-navigation-id="region-1"
17
+ >
14
18
  <p
15
19
  data-testid="region-1-text"
16
20
  data-wp-text="state.region1.text"
@@ -51,7 +55,10 @@
51
55
 
52
56
  <section>
53
57
  <h2>Region 2</h2>
54
- <div data-wp-interactive data-wp-navigation-id="region-2">
58
+ <div
59
+ data-wp-interactive='{"namespace": "router-regions"}'
60
+ data-wp-navigation-id="region-2"
61
+ >
55
62
  <p
56
63
  data-testid="region-2-text"
57
64
  data-wp-text="state.region2.text"
@@ -78,7 +85,10 @@
78
85
 
79
86
  <section>
80
87
  <h2>Nested region</h2>
81
- <div data-wp-interactive data-wp-navigation-id="nested-region">
88
+ <div
89
+ data-wp-interactive='{"namespace": "router-regions"}'
90
+ data-wp-navigation-id="nested-region"
91
+ >
82
92
  <p
83
93
  data-testid="nested-region-ssr"
84
94
  >content from page <?php echo $attributes['page']; ?></p>
@@ -1,43 +1,45 @@
1
- ( ( { wp } ) => {
2
- /**
3
- * WordPress dependencies
4
- */
5
- const { store, navigate } = wp.interactivity;
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store, navigate, getContext } from '@wordpress/interactivity';
6
5
 
7
- store( {
8
- state: {
9
- region1: {
10
- text: 'hydrated'
11
- },
12
- region2: {
13
- text: 'hydrated'
6
+ const { state } = store( 'router-regions', {
7
+ state: {
8
+ region1: {
9
+ text: 'hydrated',
10
+ },
11
+ region2: {
12
+ text: 'hydrated',
13
+ },
14
+ counter: {
15
+ value: 0,
16
+ },
17
+ },
18
+ actions: {
19
+ router: {
20
+ *navigate( e ) {
21
+ e.preventDefault();
22
+ yield navigate( e.target.href );
14
23
  },
15
- counter: {
16
- value: 0,
24
+ back() {
25
+ history.back();
17
26
  },
18
27
  },
19
- actions: {
20
- router: {
21
- navigate: async ( { event: e } ) => {
22
- e.preventDefault();
23
- await navigate( e.target.href );
24
- },
25
- back: () => history.back(),
28
+ counter: {
29
+ increment() {
30
+ const context = getContext();
31
+ if ( context?.counter ) {
32
+ context.counter.value += 1;
33
+ } else {
34
+ state.counter.value += 1;
35
+ }
26
36
  },
27
- counter: {
28
- increment: ( { state, context } ) => {
29
- if ( context.counter ) {
30
- context.counter.value += 1;
31
- } else {
32
- state.counter.value += 1;
33
- }
34
- },
35
- init: ( { context } ) => {
36
- if ( context.counter ) {
37
- context.counter.value = context.counter.initialValue;
38
- }
37
+ init() {
38
+ const context = getContext();
39
+ if ( context.counter ) {
40
+ context.counter.value = context.counter.initialValue;
39
41
  }
40
42
  },
41
43
  },
42
- } );
43
- } )( window );
44
+ },
45
+ } );
@@ -6,11 +6,14 @@
6
6
  * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
7
7
  */
8
8
 
9
+ gutenberg_enqueue_module( 'store-tag-view' );
10
+
9
11
  // These variables simulates SSR.
10
12
  $test_store_tag_counter = 'ok' === $attributes['condition'] ? 3 : 0;
11
13
  $test_store_tag_double = $test_store_tag_counter * 2;
12
14
  ?>
13
- <div data-wp-interactive>
15
+
16
+ <div data-wp-interactive='{ "namespace": "store-tag" }'>
14
17
  <div>
15
18
  Counter:
16
19
  <span
@@ -45,7 +48,7 @@ $test_store_tag_double = $test_store_tag_counter * 2;
45
48
  if ( 'missing' !== $attributes['condition'] ) {
46
49
 
47
50
  if ( 'ok' === $attributes['condition'] ) {
48
- $test_store_tag_json = '{ "state": { "counter": { "value": 3 } } }';
51
+ $test_store_tag_json = '{ "store-tag": { "counter": { "value": 3 } } }';
49
52
  }
50
53
 
51
54
  if ( 'corrupted-json' === $attributes['condition'] ) {
@@ -53,11 +56,11 @@ if ( 'missing' !== $attributes['condition'] ) {
53
56
  }
54
57
 
55
58
  if ( 'invalid-state' === $attributes['condition'] ) {
56
- $test_store_tag_json = '{ "state": null }';
59
+ $test_store_tag_json = 'null';
57
60
  }
58
61
 
59
62
  echo <<<HTML
60
- <script type="application/json" id="wp-interactivity-store-data">
63
+ <script type="application/json" id="wp-interactivity-initial-state">
61
64
  $test_store_tag_json
62
65
  </script>
63
66
  HTML;
@@ -1,24 +1,24 @@
1
- ( ( { wp } ) => {
2
- /**
3
- * WordPress dependencies
4
- */
5
- const { store } = wp.interactivity;
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store } from '@wordpress/interactivity';
6
5
 
7
- store( {
8
- state: {
9
- counter: {
10
- // `value` is defined in the server.
11
- double: ( { state } ) => state.counter.value * 2,
12
- clicks: 0,
6
+ const { state } = store( 'store-tag', {
7
+ state: {
8
+ counter: {
9
+ // `value` is defined in the server.
10
+ get double() {
11
+ return state.counter.value * 2;
13
12
  },
13
+ clicks: 0,
14
14
  },
15
- actions: {
16
- counter: {
17
- increment: ( { state } ) => {
18
- state.counter.value += 1;
19
- state.counter.clicks += 1;
20
- },
15
+ },
16
+ actions: {
17
+ counter: {
18
+ increment() {
19
+ state.counter.value += 1;
20
+ state.counter.clicks += 1;
21
21
  },
22
22
  },
23
- } );
24
- } )( window );
23
+ },
24
+ } );
@@ -8,9 +8,11 @@
8
8
  $plugin_url = plugin_dir_url( __DIR__ );
9
9
  $src_proc_ins = $plugin_url . 'tovdom/processing-instructions.js';
10
10
  $src_cdata = $plugin_url . 'tovdom/cdata.js';
11
+
12
+ gutenberg_enqueue_module( 'tovdom-view' );
11
13
  ?>
12
14
 
13
- <div data-wp-interactive>
15
+ <div data-wp-interactive='{ "namespace": "tovdom" }'>
14
16
  <div data-testid="it should delete comments">
15
17
  <!-- ##1## -->
16
18
  <div data-testid="it should keep this node between comments">
@@ -1,5 +1,6 @@
1
- ( ( { wp } ) => {
2
- const { store } = wp.interactivity;
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store } from '@wordpress/interactivity';
3
5
 
4
- store( {} );
5
- } )( window );
6
+ store( 'tovdom', {} );
@@ -5,7 +5,9 @@
5
5
  * @package gutenberg-test-interactive-blocks
6
6
  */
7
7
 
8
+ gutenberg_enqueue_module( 'tovdom-islands-view' );
8
9
  ?>
10
+
9
11
  <div>
10
12
  <div data-wp-show-mock="state.falseValue">
11
13
  <span data-testid="not inside an island">
@@ -13,7 +15,7 @@
13
15
  </span>
14
16
  </div>
15
17
 
16
- <div data-wp-interactive>
18
+ <div data-wp-interactive='{ "namespace": "tovdom-islands" }'>
17
19
  <div data-wp-show-mock="state.falseValue">
18
20
  <span data-testid="inside an island">
19
21
  This should not be shown because it is inside an island.
@@ -21,7 +23,7 @@
21
23
  </div>
22
24
  </div>
23
25
 
24
- <div data-wp-interactive>
26
+ <div data-wp-interactive='{ "namespace": "tovdom-islands" }'>
25
27
  <div data-wp-ignore>
26
28
  <div data-wp-show-mock="state.falseValue">
27
29
  <span
@@ -34,8 +36,8 @@
34
36
  </div>
35
37
  </div>
36
38
 
37
- <div data-wp-interactive>
38
- <div data-wp-interactive>
39
+ <div data-wp-interactive='{ "namespace": "tovdom-islands" }'>
40
+ <div data-wp-interactive='{ "namespace": "tovdom-islands" }'>
39
41
  <div
40
42
  data-wp-show-mock="state.falseValue"
41
43
  data-testid="island inside another island"
@@ -48,9 +50,12 @@
48
50
  </div>
49
51
  </div>
50
52
 
51
- <div data-wp-interactive>
53
+ <div data-wp-interactive='{ "namespace": "tovdom-islands" }'>
52
54
  <div>
53
- <div data-wp-interactive data-wp-ignore>
55
+ <div
56
+ data-wp-interactive='{ "namespace": "tovdom-islands" }'
57
+ data-wp-ignore
58
+ >
54
59
  <div data-wp-show-mock="state.falseValue">
55
60
  <span
56
61
  data-testid="island inside inner block of isolated island"
@@ -1,26 +1,27 @@
1
- ( ( { wp } ) => {
2
- const { store, directive, createElement } = wp.interactivity;
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store, directive, createElement as h } from '@wordpress/interactivity';
3
5
 
4
- // Fake `data-wp-show-mock` directive to test when things are removed from the
5
- // DOM. Replace with `data-wp-show` when it's ready.
6
- directive(
7
- 'show-mock',
8
- ( {
9
- directives: {
10
- "show-mock": { default: showMock },
11
- },
12
- element,
13
- evaluate,
14
- } ) => {
15
- if ( ! evaluate( showMock ) )
16
- element.props.children =
17
- createElement( "template", null, element.props.children );
6
+ // Fake `data-wp-show-mock` directive to test when things are removed from the
7
+ // DOM. Replace with `data-wp-show` when it's ready.
8
+ directive(
9
+ 'show-mock',
10
+ ( { directives: { 'show-mock': showMock }, element, evaluate } ) => {
11
+ const entry = showMock.find( ( { suffix } ) => suffix === 'default' );
12
+
13
+ if ( ! evaluate( entry ) ) {
14
+ element.props.children = h(
15
+ 'template',
16
+ null,
17
+ element.props.children
18
+ );
18
19
  }
19
- );
20
+ }
21
+ );
20
22
 
21
- store( {
22
- state: {
23
- falseValue: false,
24
- },
25
- } );
26
- } )( window );
23
+ store( 'tovdom-islands', {
24
+ state: {
25
+ falseValue: false,
26
+ },
27
+ } );
@@ -21,10 +21,10 @@ add_action(
21
21
 
22
22
  $view_file = plugin_dir_url( $block_folder ) . $name . '/' . 'view.js';
23
23
 
24
- wp_register_script(
24
+ gutenberg_register_module(
25
25
  $name . '-view',
26
26
  $view_file,
27
- array( 'wp-interactivity' ),
27
+ array( '@wordpress/interactivity' ),
28
28
  filemtime( $view_file ),
29
29
  true
30
30
  );
@@ -56,7 +56,7 @@ function formatDatePickerValues(
56
56
 
57
57
  async function getPublishingDate() {
58
58
  return page.$eval(
59
- '.edit-post-post-schedule__toggle',
59
+ '.editor-post-schedule__dialog-toggle',
60
60
  ( dateLabel ) => dateLabel.textContent
61
61
  );
62
62
  }
@@ -83,7 +83,7 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
83
83
 
84
84
  it( 'should show the publishing date if the date is in the past', async () => {
85
85
  // Open the datepicker.
86
- await page.click( '.edit-post-post-schedule__toggle' );
86
+ await page.click( '.editor-post-schedule__dialog-toggle' );
87
87
 
88
88
  // Change the publishing date to a year in the past.
89
89
  await page.click( '.components-datetime__time-field-year' );
@@ -91,7 +91,7 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
91
91
  const datePickerValues = await getDatePickerValues();
92
92
 
93
93
  // Close the datepicker.
94
- await page.click( '.edit-post-post-schedule__toggle' );
94
+ await page.click( '.editor-post-schedule__dialog-toggle' );
95
95
 
96
96
  const publishingDate = await getPublishingDate();
97
97
 
@@ -102,7 +102,7 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
102
102
 
103
103
  it( 'should show the publishing date if the date is in the future', async () => {
104
104
  // Open the datepicker.
105
- await page.click( '.edit-post-post-schedule__toggle' );
105
+ await page.click( '.editor-post-schedule__dialog-toggle' );
106
106
 
107
107
  // Change the publishing date to a year in the future.
108
108
  await page.click( '.components-datetime__time-field-year' );
@@ -110,7 +110,7 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
110
110
  const datePickerValues = await getDatePickerValues();
111
111
 
112
112
  // Close the datepicker.
113
- await page.click( '.edit-post-post-schedule__toggle' );
113
+ await page.click( '.editor-post-schedule__dialog-toggle' );
114
114
 
115
115
  const publishingDate = await getPublishingDate();
116
116
 
@@ -123,17 +123,17 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
123
123
 
124
124
  it( `should show the publishing date as "Immediately" if the date is cleared`, async () => {
125
125
  // Open the datepicker.
126
- await page.click( '.edit-post-post-schedule__toggle' );
126
+ await page.click( '.editor-post-schedule__dialog-toggle' );
127
127
 
128
128
  // Change the publishing date to a year in the future.
129
129
  await page.click( '.components-datetime__time-field-year' );
130
130
  await page.keyboard.press( 'ArrowUp' );
131
131
 
132
132
  // Close the datepicker.
133
- await page.click( '.edit-post-post-schedule__toggle' );
133
+ await page.click( '.editor-post-schedule__dialog-toggle' );
134
134
 
135
135
  // Open the datepicker.
136
- await page.click( '.edit-post-post-schedule__toggle' );
136
+ await page.click( '.editor-post-schedule__dialog-toggle' );
137
137
 
138
138
  // Clear the date.
139
139
  await page.click(
@@ -112,7 +112,7 @@ describe( 'Pattern blocks', () => {
112
112
 
113
113
  // Convert block to a regular block.
114
114
  await clickBlockToolbarButton( 'Options' );
115
- await clickMenuItem( 'Detach pattern' );
115
+ await clickMenuItem( 'Detach' );
116
116
 
117
117
  // Check that we have a paragraph block on the page.
118
118
  const paragraphBlock = await canvas().$(
@@ -219,7 +219,7 @@ describe( 'Pattern blocks', () => {
219
219
 
220
220
  // Convert block to a regular block.
221
221
  await clickBlockToolbarButton( 'Options' );
222
- await clickMenuItem( 'Detach patterns' );
222
+ await clickMenuItem( 'Detach' );
223
223
 
224
224
  // Check that we have two paragraph blocks on the page.
225
225
  expect( await getEditedPostContent() ).toMatchSnapshot();
@@ -350,9 +350,9 @@ describe( 'Pattern blocks', () => {
350
350
  expect( reusableBlockWithParagraph ).toBeTruthy();
351
351
 
352
352
  // Convert back to regular blocks.
353
- await clickBlockToolbarButton( 'Select Edited block' );
353
+ await clickBlockToolbarButton( 'Select parent block: Edited block' );
354
354
  await clickBlockToolbarButton( 'Options' );
355
- await clickMenuItem( 'Detach pattern' );
355
+ await clickMenuItem( 'Detach' );
356
356
  await page.waitForXPath( selector, {
357
357
  hidden: true,
358
358
  } );
@@ -46,7 +46,7 @@ describe( 'Scheduling', () => {
46
46
  await page.keyboard.press( 'ArrowUp' );
47
47
 
48
48
  // Close the datepicker.
49
- await page.click( '.edit-post-post-schedule__toggle' );
49
+ await page.click( '.editor-post-schedule__dialog-toggle' );
50
50
 
51
51
  expect( await getPublishButtonText() ).toBe( 'Schedule…' );
52
52
  } );
@@ -1,14 +0,0 @@
1
- {
2
- "apiVersion": 2,
3
- "name": "test/directive-effect",
4
- "title": "E2E Interactivity tests - directive effect",
5
- "category": "text",
6
- "icon": "heart",
7
- "description": "",
8
- "supports": {
9
- "interactivity": true
10
- },
11
- "textdomain": "e2e-interactivity",
12
- "viewScript": "directive-effect-view",
13
- "render": "file:./render.php"
14
- }
@@ -1,59 +0,0 @@
1
- ( ( { wp } ) => {
2
- const { store, directive } = wp.interactivity;
3
-
4
- // Fake `data-wp-show-mock` directive to test when things are removed from the
5
- // DOM. Replace with `data-wp-show` when it's ready.
6
- directive(
7
- 'show-mock',
8
- ( {
9
- directives: {
10
- "show-mock": { default: showMock },
11
- },
12
- element,
13
- evaluate,
14
- } ) => {
15
- if ( ! evaluate( showMock ) ) return null;
16
- return element;
17
- }
18
- );
19
-
20
- store( {
21
- state: {
22
- isOpen: true,
23
- isElementInTheDOM: false,
24
- counter: 0,
25
- },
26
- selectors: {
27
- elementInTheDOM: ( { state } ) =>
28
- state.isElementInTheDOM
29
- ? 'element is in the DOM'
30
- : 'element is not in the DOM',
31
- },
32
- actions: {
33
- toggle( { state } ) {
34
- state.isOpen = ! state.isOpen;
35
- },
36
- increment( { state } ) {
37
- state.counter = state.counter + 1;
38
- },
39
- },
40
- effects: {
41
- elementAddedToTheDOM: ( { state } ) => {
42
- state.isElementInTheDOM = true;
43
-
44
- return () => {
45
- state.isElementInTheDOM = false;
46
- };
47
- },
48
- changeFocus: ( { state } ) => {
49
- if ( state.isOpen ) {
50
- document.querySelector( "[data-testid='input']" ).focus();
51
- }
52
- },
53
- infiniteLoop: ({ state }) => {
54
- state.counter = state.counter + 1;
55
- }
56
- },
57
- } );
58
-
59
- } )( window );