@wordpress/e2e-tests 7.12.0 → 7.13.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 (31) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/mu-plugins/enable-templates-ui.php +1 -1
  3. package/mu-plugins/nocache-headers.php +1 -1
  4. package/package.json +7 -7
  5. package/plugins/block-context.php +1 -1
  6. package/plugins/iframed-block.php +2 -2
  7. package/plugins/iframed-enqueue-block-assets.php +1 -1
  8. package/plugins/iframed-enqueue-block-editor-settings.php +1 -1
  9. package/plugins/iframed-inline-styles.php +3 -3
  10. package/plugins/iframed-masonry-block.php +2 -2
  11. package/plugins/iframed-multiple-stylesheets.php +2 -2
  12. package/plugins/inner-blocks-allowed-blocks/index.js +16 -10
  13. package/plugins/interactive-blocks/router-navigate/block.json +14 -0
  14. package/plugins/interactive-blocks/router-navigate/render.php +51 -0
  15. package/plugins/interactive-blocks/router-navigate/view.js +41 -0
  16. package/plugins/interactive-blocks.php +3 -4
  17. package/plugins/marquee-function-widget.php +2 -2
  18. package/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap +2 -2
  19. package/specs/editor/plugins/annotations.test.js +5 -12
  20. package/specs/editor/plugins/container-blocks.test.js +1 -1
  21. package/specs/editor/plugins/custom-taxonomies.test.js +1 -1
  22. package/specs/editor/plugins/inner-blocks-render-appender.test.js +2 -2
  23. package/specs/editor/plugins/meta-boxes.test.js +2 -3
  24. package/specs/editor/various/__snapshots__/{reusable-blocks.test.js.snap → pattern-blocks.test.js.snap} +2 -2
  25. package/specs/editor/various/change-detection.test.js +1 -1
  26. package/specs/editor/various/inserting-blocks.test.js +2 -2
  27. package/specs/editor/various/{reusable-blocks.test.js → pattern-blocks.test.js} +15 -15
  28. package/specs/site-editor/multi-entity-saving.test.js +2 -3
  29. package/specs/widgets/editing-widgets.test.js +4 -6
  30. package/specs/editor/various/__snapshots__/rich-text.test.js.snap +0 -231
  31. package/specs/editor/various/rich-text.test.js +0 -570
@@ -4,7 +4,7 @@
4
4
  import {
5
5
  clickMenuItem,
6
6
  insertBlock,
7
- insertReusableBlock,
7
+ insertPattern,
8
8
  createNewPost,
9
9
  clickBlockToolbarButton,
10
10
  pressKeyWithModifier,
@@ -19,9 +19,9 @@ import {
19
19
  canvas,
20
20
  } from '@wordpress/e2e-test-utils';
21
21
 
22
- const reusableBlockNameInputSelector =
22
+ const patternBlockNameInputSelector =
23
23
  '.patterns-menu-items__convert-modal .components-text-control__input';
24
- const reusableBlockInspectorNameInputSelector =
24
+ const patternBlockInspectorNameInputSelector =
25
25
  '.block-editor-block-inspector .components-text-control__input';
26
26
  const syncToggleSelectorChecked =
27
27
  '.patterns-menu-items__convert-modal .components-form-toggle.is-checked';
@@ -60,7 +60,7 @@ const clearAllBlocks = async () => {
60
60
  } );
61
61
  };
62
62
 
63
- describe( 'Reusable blocks', () => {
63
+ describe( 'Pattern blocks', () => {
64
64
  afterAll( async () => {
65
65
  await trashAllPosts( 'wp_block' );
66
66
  } );
@@ -74,12 +74,12 @@ describe( 'Reusable blocks', () => {
74
74
  await clearAllBlocks();
75
75
 
76
76
  // Insert the reusable block we created above.
77
- await insertReusableBlock( 'Greeting block' );
77
+ await insertPattern( 'Greeting block' );
78
78
 
79
79
  // Change the block's title.
80
80
  await openDocumentSettingsSidebar();
81
81
  const nameInput = await page.waitForSelector(
82
- reusableBlockInspectorNameInputSelector
82
+ patternBlockInspectorNameInputSelector
83
83
  );
84
84
  await nameInput.click();
85
85
  await pressKeyWithModifier( 'primary', 'a' );
@@ -108,7 +108,7 @@ describe( 'Reusable blocks', () => {
108
108
  await clearAllBlocks();
109
109
 
110
110
  // Insert the reusable block we edited above.
111
- await insertReusableBlock( 'Surprised greeting block' );
111
+ await insertPattern( 'Surprised greeting block' );
112
112
 
113
113
  // Convert block to a regular block.
114
114
  await clickBlockToolbarButton( 'Options' );
@@ -170,12 +170,12 @@ describe( 'Reusable blocks', () => {
170
170
  await createNewPost();
171
171
 
172
172
  // Step 3. Insert the block created in Step 1.
173
- await insertReusableBlock( 'Awesome block' );
173
+ await insertPattern( 'Awesome block' );
174
174
 
175
175
  // Check the title.
176
176
  await openDocumentSettingsSidebar();
177
177
  const title = await page.$eval(
178
- reusableBlockInspectorNameInputSelector,
178
+ patternBlockInspectorNameInputSelector,
179
179
  ( element ) => element.value
180
180
  );
181
181
  expect( title ).toBe( 'Awesome block' );
@@ -200,7 +200,7 @@ describe( 'Reusable blocks', () => {
200
200
 
201
201
  // Set title.
202
202
  const nameInput = await page.waitForSelector(
203
- reusableBlockNameInputSelector
203
+ patternBlockNameInputSelector
204
204
  );
205
205
  await nameInput.click();
206
206
  await page.keyboard.type( 'Multi-selection reusable block' );
@@ -215,7 +215,7 @@ describe( 'Reusable blocks', () => {
215
215
  await clearAllBlocks();
216
216
 
217
217
  // Insert the reusable block we edited above.
218
- await insertReusableBlock( 'Multi-selection reusable block' );
218
+ await insertPattern( 'Multi-selection reusable block' );
219
219
 
220
220
  // Convert block to a regular block.
221
221
  await clickBlockToolbarButton( 'Options' );
@@ -231,7 +231,7 @@ describe( 'Reusable blocks', () => {
231
231
  'Random reusable block'
232
232
  );
233
233
  await clearAllBlocks();
234
- await insertReusableBlock( 'Random reusable block' );
234
+ await insertPattern( 'Random reusable block' );
235
235
 
236
236
  await visitAdminPage( 'edit.php', [ 'post_type=wp_block' ] );
237
237
 
@@ -298,8 +298,8 @@ describe( 'Reusable blocks', () => {
298
298
  'Duplicated reusable block'
299
299
  );
300
300
  await clearAllBlocks();
301
- await insertReusableBlock( 'Duplicated reusable block' );
302
- await insertReusableBlock( 'Duplicated reusable block' );
301
+ await insertPattern( 'Duplicated reusable block' );
302
+ await insertPattern( 'Duplicated reusable block' );
303
303
  await saveDraft();
304
304
  await page.reload();
305
305
  await page.waitForSelector( 'iframe[name="editor-canvas"]' );
@@ -384,7 +384,7 @@ describe( 'Reusable blocks', () => {
384
384
  await clickBlockToolbarButton( 'Options' );
385
385
  await clickMenuItem( 'Create pattern' );
386
386
  const nameInput = await page.waitForSelector(
387
- reusableBlockNameInputSelector
387
+ patternBlockNameInputSelector
388
388
  );
389
389
  await nameInput.click();
390
390
  await page.keyboard.type( 'Block with styles' );
@@ -77,9 +77,8 @@ describe( 'Multi-entity save flow', () => {
77
77
 
78
78
  // Reusable assertions inside Post editor.
79
79
  const assertMultiSaveEnabled = async () => {
80
- const multiSaveButton = await page.waitForSelector(
81
- multiSaveSelector
82
- );
80
+ const multiSaveButton =
81
+ await page.waitForSelector( multiSaveSelector );
83
82
  expect( multiSaveButton ).not.toBeNull();
84
83
  };
85
84
  const assertMultiSaveDisabled = async () => {
@@ -388,9 +388,8 @@ describe( 'Widgets screen', () => {
388
388
  name: 'Block: Widget Area',
389
389
  } );
390
390
  await firstWidgetArea.focus();
391
- const marqueeBlock = await getBlockInGlobalInserter(
392
- 'Marquee Greeting'
393
- );
391
+ const marqueeBlock =
392
+ await getBlockInGlobalInserter( 'Marquee Greeting' );
394
393
  await marqueeBlock.click();
395
394
  await page.waitForFunction(
396
395
  ( expectedMarquees ) => {
@@ -721,9 +720,8 @@ describe( 'Widgets screen', () => {
721
720
  const [ firstWidgetArea, secondWidgetArea ] = widgetAreas;
722
721
 
723
722
  // Insert a paragraph it should be in the first widget area.
724
- const inserterParagraphBlock = await getBlockInGlobalInserter(
725
- 'Paragraph'
726
- );
723
+ const inserterParagraphBlock =
724
+ await getBlockInGlobalInserter( 'Paragraph' );
727
725
  await inserterParagraphBlock.hover();
728
726
  await inserterParagraphBlock.click();
729
727
  const addedParagraphBlockInFirstWidgetArea = await find(
@@ -1,231 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`RichText should apply active formatting for inline paste 1`] = `
4
- "<!-- wp:paragraph -->
5
- <p><strong>132</strong>3</p>
6
- <!-- /wp:paragraph -->"
7
- `;
8
-
9
- exports[`RichText should apply formatting when selection is collapsed 1`] = `
10
- "<!-- wp:paragraph -->
11
- <p>Some <strong>bold</strong>.</p>
12
- <!-- /wp:paragraph -->"
13
- `;
14
-
15
- exports[`RichText should apply formatting with primary shortcut 1`] = `
16
- "<!-- wp:paragraph -->
17
- <p><strong>test</strong></p>
18
- <!-- /wp:paragraph -->"
19
- `;
20
-
21
- exports[`RichText should apply multiple formats when selection is collapsed 1`] = `
22
- "<!-- wp:paragraph -->
23
- <p><strong><em>1</em></strong>.</p>
24
- <!-- /wp:paragraph -->"
25
- `;
26
-
27
- exports[`RichText should copy/paste heading 1`] = `
28
- "<!-- wp:heading -->
29
- <h2 class="wp-block-heading">Heading</h2>
30
- <!-- /wp:heading -->
31
-
32
- <!-- wp:heading -->
33
- <h2 class="wp-block-heading">Heading</h2>
34
- <!-- /wp:heading -->"
35
- `;
36
-
37
- exports[`RichText should handle Home and End keys 1`] = `
38
- "<!-- wp:paragraph -->
39
- <p>-<strong>12</strong>+</p>
40
- <!-- /wp:paragraph -->"
41
- `;
42
-
43
- exports[`RichText should handle change in tag name gracefully 1`] = `
44
- "<!-- wp:heading {"level":3} -->
45
- <h3 class="wp-block-heading"></h3>
46
- <!-- /wp:heading -->"
47
- `;
48
-
49
- exports[`RichText should keep internal selection after blur 1`] = `
50
- "<!-- wp:paragraph -->
51
- <p>1<strong>2</strong></p>
52
- <!-- /wp:paragraph -->"
53
- `;
54
-
55
- exports[`RichText should make bold after split and merge 1`] = `
56
- "<!-- wp:paragraph -->
57
- <p>1<strong>2</strong></p>
58
- <!-- /wp:paragraph -->"
59
- `;
60
-
61
- exports[`RichText should navigate arround emoji 1`] = `
62
- "<!-- wp:paragraph -->
63
- <p>1🍓</p>
64
- <!-- /wp:paragraph -->"
65
- `;
66
-
67
- exports[`RichText should navigate consecutive format boundaries 1`] = `
68
- "<!-- wp:paragraph -->
69
- <p><strong>1</strong><em>2</em></p>
70
- <!-- /wp:paragraph -->"
71
- `;
72
-
73
- exports[`RichText should navigate consecutive format boundaries 2`] = `
74
- "<!-- wp:paragraph -->
75
- <p><strong>1</strong>-<em>2</em></p>
76
- <!-- /wp:paragraph -->"
77
- `;
78
-
79
- exports[`RichText should not format text after code backtick 1`] = `
80
- "<!-- wp:paragraph -->
81
- <p>A <code>backtick</code> and more.</p>
82
- <!-- /wp:paragraph -->"
83
- `;
84
-
85
- exports[`RichText should not lose selection direction 1`] = `
86
- "<!-- wp:paragraph -->
87
- <p><strong>1</strong>2-3</p>
88
- <!-- /wp:paragraph -->"
89
- `;
90
-
91
- exports[`RichText should not split rich text on inline paste 1`] = `
92
- "<!-- wp:paragraph -->
93
- <p>123</p>
94
- <!-- /wp:paragraph -->"
95
- `;
96
-
97
- exports[`RichText should not split rich text on inline paste with formatting 1`] = `
98
- "<!-- wp:paragraph -->
99
- <p>a1<strong>2</strong>3b</p>
100
- <!-- /wp:paragraph -->"
101
- `;
102
-
103
- exports[`RichText should not undo backtick transform with backspace after selection change 1`] = `""`;
104
-
105
- exports[`RichText should not undo backtick transform with backspace after typing 1`] = `""`;
106
-
107
- exports[`RichText should only mutate text data on input 1`] = `
108
- "<!-- wp:paragraph -->
109
- <p>1<strong>2</strong>34</p>
110
- <!-- /wp:paragraph -->"
111
- `;
112
-
113
- exports[`RichText should paste list contents into paragraph 1`] = `
114
- "<!-- wp:list -->
115
- <ul><!-- wp:list-item -->
116
- <li>1<!-- wp:list -->
117
- <ul><!-- wp:list-item -->
118
- <li>2</li>
119
- <!-- /wp:list-item --></ul>
120
- <!-- /wp:list --></li>
121
- <!-- /wp:list-item --></ul>
122
- <!-- /wp:list -->
123
-
124
- <!-- wp:list -->
125
- <ul><!-- wp:list-item -->
126
- <li>1<!-- wp:list -->
127
- <ul><!-- wp:list-item -->
128
- <li>2</li>
129
- <!-- /wp:list-item --></ul>
130
- <!-- /wp:list --></li>
131
- <!-- /wp:list-item --></ul>
132
- <!-- /wp:list -->"
133
- `;
134
-
135
- exports[`RichText should paste paragraph contents into list 1`] = `
136
- "<!-- wp:paragraph -->
137
- <p>1<br>2</p>
138
- <!-- /wp:paragraph -->
139
-
140
- <!-- wp:list -->
141
- <ul><!-- wp:list-item -->
142
- <li>1</li>
143
- <!-- /wp:list-item -->
144
-
145
- <!-- wp:list-item -->
146
- <li>2</li>
147
- <!-- /wp:list-item --></ul>
148
- <!-- /wp:list -->"
149
- `;
150
-
151
- exports[`RichText should preserve internal formatting 1`] = `
152
- "<!-- wp:paragraph -->
153
- <p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color">1</mark></p>
154
- <!-- /wp:paragraph -->"
155
- `;
156
-
157
- exports[`RichText should preserve internal formatting 2`] = `
158
- "<!-- wp:paragraph -->
159
- <p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color">1</mark></p>
160
- <!-- /wp:paragraph -->
161
-
162
- <!-- wp:paragraph -->
163
- <p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-cyan-bluish-gray-color">1</mark></p>
164
- <!-- /wp:paragraph -->"
165
- `;
166
-
167
- exports[`RichText should return focus when pressing formatting button 1`] = `
168
- "<!-- wp:paragraph -->
169
- <p>Some <strong>bold</strong>.</p>
170
- <!-- /wp:paragraph -->"
171
- `;
172
-
173
- exports[`RichText should run input rules after composition end 1`] = `
174
- "<!-- wp:paragraph -->
175
- <p><code>a</code></p>
176
- <!-- /wp:paragraph -->"
177
- `;
178
-
179
- exports[`RichText should split rich text on paste 1`] = `
180
- "<!-- wp:paragraph -->
181
- <p>a</p>
182
- <!-- /wp:paragraph -->
183
-
184
- <!-- wp:paragraph -->
185
- <p>1</p>
186
- <!-- /wp:paragraph -->
187
-
188
- <!-- wp:paragraph -->
189
- <p>2</p>
190
- <!-- /wp:paragraph -->
191
-
192
- <!-- wp:paragraph -->
193
- <p>b</p>
194
- <!-- /wp:paragraph -->"
195
- `;
196
-
197
- exports[`RichText should transform backtick to code 1`] = `
198
- "<!-- wp:paragraph -->
199
- <p>A <code>backtick</code></p>
200
- <!-- /wp:paragraph -->"
201
- `;
202
-
203
- exports[`RichText should transform backtick to code 2`] = `
204
- "<!-- wp:paragraph -->
205
- <p>A \`backtick\`</p>
206
- <!-- /wp:paragraph -->"
207
- `;
208
-
209
- exports[`RichText should transform when typing backtick over selection 1`] = `
210
- "<!-- wp:paragraph -->
211
- <p>A <code>selection</code> test.</p>
212
- <!-- /wp:paragraph -->"
213
- `;
214
-
215
- exports[`RichText should transform when typing backtick over selection 2`] = `
216
- "<!-- wp:paragraph -->
217
- <p>A \`selection\` test.</p>
218
- <!-- /wp:paragraph -->"
219
- `;
220
-
221
- exports[`RichText should undo backtick transform with backspace 1`] = `
222
- "<!-- wp:paragraph -->
223
- <p>\`a\`</p>
224
- <!-- /wp:paragraph -->"
225
- `;
226
-
227
- exports[`RichText should update internal selection after fresh focus 1`] = `
228
- "<!-- wp:paragraph -->
229
- <p>1<strong>2</strong></p>
230
- <!-- /wp:paragraph -->"
231
- `;