@wordpress/e2e-tests 4.5.0 → 4.8.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 (53) hide show
  1. package/package.json +7 -7
  2. package/plugins/cpt-locking.php +28 -4
  3. package/specs/editor/blocks/__snapshots__/quote.test.js.snap +37 -131
  4. package/specs/editor/blocks/gallery.test.js +1 -1
  5. package/specs/editor/blocks/navigation.test.js +11 -50
  6. package/specs/editor/blocks/quote.test.js +9 -104
  7. package/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap +24 -8
  8. package/specs/editor/plugins/__snapshots__/inner-blocks-render-appender.test.js.snap +6 -2
  9. package/specs/editor/plugins/__snapshots__/templates.test.js.snap +6 -2
  10. package/specs/editor/plugins/block-variations.test.js +2 -0
  11. package/specs/editor/plugins/cpt-locking.test.js +3 -3
  12. package/specs/editor/plugins/iframed-block.test.js +3 -2
  13. package/specs/editor/plugins/iframed-masonry-block.test.js +3 -2
  14. package/specs/editor/plugins/inner-blocks-render-appender.test.js +3 -0
  15. package/specs/editor/plugins/meta-boxes.test.js +1 -1
  16. package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +0 -16
  17. package/specs/editor/various/__snapshots__/writing-flow.test.js.snap +3 -3
  18. package/specs/editor/various/block-switcher.test.js +1 -3
  19. package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
  20. package/specs/editor/various/datepicker.test.js +9 -11
  21. package/specs/editor/various/links.test.js +3 -3
  22. package/specs/editor/various/multi-block-selection.test.js +2 -29
  23. package/specs/editor/various/post-visibility.test.js +4 -4
  24. package/specs/editor/various/reusable-blocks.test.js +2 -0
  25. package/specs/editor/various/scheduling.test.js +2 -2
  26. package/specs/editor/various/{sidebar-permalink-panel.test.js → sidebar-permalink.test.js} +9 -19
  27. package/specs/editor/various/sidebar.test.js +4 -6
  28. package/specs/editor/various/typewriter.test.js +2 -2
  29. package/specs/editor/various/writing-flow.test.js +74 -1
  30. package/specs/editor/blocks/__snapshots__/buttons.test.js.snap +0 -33
  31. package/specs/editor/blocks/__snapshots__/list.test.js.snap +0 -337
  32. package/specs/editor/blocks/__snapshots__/spacer.test.js.snap +0 -13
  33. package/specs/editor/blocks/__snapshots__/table.test.js.snap +0 -61
  34. package/specs/editor/blocks/buttons.test.js +0 -95
  35. package/specs/editor/blocks/comments.test.js +0 -131
  36. package/specs/editor/blocks/list.test.js +0 -542
  37. package/specs/editor/blocks/spacer.test.js +0 -48
  38. package/specs/editor/blocks/table.test.js +0 -295
  39. package/specs/editor/plugins/__snapshots__/format-api.test.js.snap +0 -7
  40. package/specs/editor/plugins/__snapshots__/hooks-api.test.js.snap +0 -3
  41. package/specs/editor/plugins/format-api.test.js +0 -36
  42. package/specs/editor/plugins/hooks-api.test.js +0 -44
  43. package/specs/editor/various/__snapshots__/rtl.test.js.snap +0 -63
  44. package/specs/editor/various/block-mover.test.js +0 -42
  45. package/specs/editor/various/preview.test.js +0 -425
  46. package/specs/editor/various/rtl.test.js +0 -129
  47. package/specs/site-editor/style-variations.test.js +0 -213
  48. package/themes/style-variations/block-templates/index.html +0 -11
  49. package/themes/style-variations/index.php +0 -0
  50. package/themes/style-variations/style.css +0 -15
  51. package/themes/style-variations/styles/pink.json +0 -33
  52. package/themes/style-variations/styles/yellow.json +0 -12
  53. package/themes/style-variations/theme.json +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "4.5.0",
3
+ "version": "4.8.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",
@@ -23,11 +23,11 @@
23
23
  "node": ">=12"
24
24
  },
25
25
  "dependencies": {
26
- "@wordpress/e2e-test-utils": "^7.7.0",
27
- "@wordpress/jest-console": "^5.3.0",
28
- "@wordpress/jest-puppeteer-axe": "^4.0.2",
29
- "@wordpress/scripts": "^23.3.0",
30
- "@wordpress/url": "^3.12.0",
26
+ "@wordpress/e2e-test-utils": "^7.10.0",
27
+ "@wordpress/jest-console": "^5.4.0",
28
+ "@wordpress/jest-puppeteer-axe": "^4.1.0",
29
+ "@wordpress/scripts": "^23.6.0",
30
+ "@wordpress/url": "^3.15.0",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
33
33
  "filenamify": "^4.2.0",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b"
49
+ "gitHead": "0315dbc240cb2aa146d7c1bafd251f004b88300e"
50
50
  }
@@ -19,7 +19,13 @@ function gutenberg_test_cpt_locking() {
19
19
  'placeholder' => 'Add a description',
20
20
  ),
21
21
  ),
22
- array( 'core/quote' ),
22
+ array(
23
+ 'core/quote',
24
+ array(),
25
+ array(
26
+ array( 'core/paragraph' ),
27
+ ),
28
+ ),
23
29
  array( 'core/columns' ),
24
30
  );
25
31
  register_post_type(
@@ -65,7 +71,13 @@ function gutenberg_test_cpt_locking() {
65
71
  'templateLock' => false,
66
72
  ),
67
73
  array(
68
- array( 'core/quote' ),
74
+ array(
75
+ 'core/quote',
76
+ array(),
77
+ array(
78
+ array( 'core/paragraph' ),
79
+ ),
80
+ ),
69
81
  array(
70
82
  'core/paragraph',
71
83
  array(
@@ -91,7 +103,13 @@ function gutenberg_test_cpt_locking() {
91
103
  'templateLock' => 'all',
92
104
  ),
93
105
  array(
94
- array( 'core/quote' ),
106
+ array(
107
+ 'core/quote',
108
+ array(),
109
+ array(
110
+ array( 'core/paragraph' ),
111
+ ),
112
+ ),
95
113
  array(
96
114
  'core/paragraph',
97
115
  array(
@@ -115,7 +133,13 @@ function gutenberg_test_cpt_locking() {
115
133
  'core/group',
116
134
  array(),
117
135
  array(
118
- array( 'core/quote' ),
136
+ array(
137
+ 'core/quote',
138
+ array(),
139
+ array(
140
+ array( 'core/paragraph' ),
141
+ ),
142
+ ),
119
143
  array(
120
144
  'core/paragraph',
121
145
  array(
@@ -34,180 +34,86 @@ exports[`Quote can be converted to paragraphs and renders one paragraph block pe
34
34
 
35
35
  exports[`Quote can be converted to paragraphs and renders only one paragraph for the cite, if the quote is void 1`] = `
36
36
  "<!-- wp:paragraph -->
37
+ <p></p>
38
+ <!-- /wp:paragraph -->
39
+
40
+ <!-- wp:paragraph -->
37
41
  <p>cite</p>
38
42
  <!-- /wp:paragraph -->"
39
43
  `;
40
44
 
41
45
  exports[`Quote can be created by converting a heading 1`] = `
42
46
  "<!-- wp:quote -->
43
- <blockquote class=\\"wp-block-quote\\"><p>test</p></blockquote>
47
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:heading -->
48
+ <h2>test</h2>
49
+ <!-- /wp:heading --></blockquote>
44
50
  <!-- /wp:quote -->"
45
51
  `;
46
52
 
47
53
  exports[`Quote can be created by converting a paragraph 1`] = `
48
54
  "<!-- wp:quote -->
49
- <blockquote class=\\"wp-block-quote\\"><p>test</p></blockquote>
55
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
56
+ <p>test</p>
57
+ <!-- /wp:paragraph --></blockquote>
50
58
  <!-- /wp:quote -->"
51
59
  `;
52
60
 
53
61
  exports[`Quote can be created by converting multiple paragraphs 1`] = `
54
62
  "<!-- wp:quote -->
55
- <blockquote class=\\"wp-block-quote\\"><p>one</p><p>two</p></blockquote>
63
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
64
+ <p>one</p>
65
+ <!-- /wp:paragraph -->
66
+
67
+ <!-- wp:paragraph -->
68
+ <p>two</p>
69
+ <!-- /wp:paragraph --></blockquote>
56
70
  <!-- /wp:quote -->"
57
71
  `;
58
72
 
59
73
  exports[`Quote can be created by typing "/quote" 1`] = `
60
74
  "<!-- wp:quote -->
61
- <blockquote class=\\"wp-block-quote\\"><p>I’m a quote</p></blockquote>
75
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
76
+ <p>I’m a quote</p>
77
+ <!-- /wp:paragraph --></blockquote>
62
78
  <!-- /wp:quote -->"
63
79
  `;
64
80
 
65
81
  exports[`Quote can be created by typing > in front of text of a paragraph block 1`] = `
66
82
  "<!-- wp:quote -->
67
- <blockquote class=\\"wp-block-quote\\"><p>test</p></blockquote>
83
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
84
+ <p>test</p>
85
+ <!-- /wp:paragraph --></blockquote>
68
86
  <!-- /wp:quote -->"
69
87
  `;
70
88
 
71
89
  exports[`Quote can be created by using > at the start of a paragraph block 1`] = `
72
90
  "<!-- wp:quote -->
73
- <blockquote class=\\"wp-block-quote\\"><p>A quote</p><p>Another paragraph</p></blockquote>
74
- <!-- /wp:quote -->"
75
- `;
76
-
77
- exports[`Quote can be merged into from a paragraph 1`] = `
78
- "<!-- wp:quote -->
79
- <blockquote class=\\"wp-block-quote\\"><p>test</p></blockquote>
80
- <!-- /wp:quote -->"
81
- `;
82
-
83
- exports[`Quote can be split at the end and merged back 1`] = `
84
- "<!-- wp:quote -->
85
- <blockquote class=\\"wp-block-quote\\"><p>1</p></blockquote>
86
- <!-- /wp:quote -->
91
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
92
+ <p>A quote</p>
93
+ <!-- /wp:paragraph -->
87
94
 
88
95
  <!-- wp:paragraph -->
89
- <p></p>
90
- <!-- /wp:paragraph -->"
91
- `;
92
-
93
- exports[`Quote can be split at the end and merged back 2`] = `
94
- "<!-- wp:quote -->
95
- <blockquote class=\\"wp-block-quote\\"><p>1</p><p></p></blockquote>
96
+ <p>Another paragraph</p>
97
+ <!-- /wp:paragraph --></blockquote>
96
98
  <!-- /wp:quote -->"
97
99
  `;
98
100
 
99
- exports[`Quote can be split at the end and merged back 3`] = `
101
+ exports[`Quote can be split at the end 1`] = `
100
102
  "<!-- wp:quote -->
101
- <blockquote class=\\"wp-block-quote\\"><p>1</p></blockquote>
102
- <!-- /wp:quote -->"
103
- `;
104
-
105
- exports[`Quote can be split in the middle and merged back 1`] = `
106
- "<!-- wp:quote -->
107
- <blockquote class=\\"wp-block-quote\\"><p>1</p><cite>c</cite></blockquote>
103
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
104
+ <p>1</p>
105
+ <!-- /wp:paragraph --></blockquote>
108
106
  <!-- /wp:quote -->
109
107
 
110
108
  <!-- wp:paragraph -->
111
109
  <p></p>
112
- <!-- /wp:paragraph -->
113
-
114
- <!-- wp:quote -->
115
- <blockquote class=\\"wp-block-quote\\"><p>2</p><cite>c</cite></blockquote>
116
- <!-- /wp:quote -->"
117
- `;
118
-
119
- exports[`Quote can be split in the middle and merged back 2`] = `
120
- "<!-- wp:quote -->
121
- <blockquote class=\\"wp-block-quote\\"><p>1</p><p></p><cite>c</cite></blockquote>
122
- <!-- /wp:quote -->
123
-
124
- <!-- wp:quote -->
125
- <blockquote class=\\"wp-block-quote\\"><p>2</p><cite>c</cite></blockquote>
126
- <!-- /wp:quote -->"
127
- `;
128
-
129
- exports[`Quote can be split in the middle and merged back 3`] = `
130
- "<!-- wp:quote -->
131
- <blockquote class=\\"wp-block-quote\\"><p>1</p><cite>c</cite></blockquote>
132
- <!-- /wp:quote -->
133
-
134
- <!-- wp:quote -->
135
- <blockquote class=\\"wp-block-quote\\"><p>2</p><cite>c</cite></blockquote>
136
- <!-- /wp:quote -->"
110
+ <!-- /wp:paragraph -->"
137
111
  `;
138
112
 
139
- exports[`Quote can be split in the middle and merged back 4`] = `
113
+ exports[`Quote can be split at the end 2`] = `
140
114
  "<!-- wp:quote -->
141
- <blockquote class=\\"wp-block-quote\\"><p>1</p><p>2</p><cite>c</cite></blockquote>
142
- <!-- /wp:quote -->"
143
- `;
144
-
145
- exports[`Quote is transformed to a heading and a quote if the quote contains a citation 1`] = `
146
- "<!-- wp:heading -->
147
- <h2>one</h2>
148
- <!-- /wp:heading -->
149
-
150
- <!-- wp:quote -->
151
- <blockquote class=\\"wp-block-quote\\"><p></p><cite>cite</cite></blockquote>
152
- <!-- /wp:quote -->"
153
- `;
154
-
155
- exports[`Quote is transformed to a heading and a quote if the quote contains multiple paragraphs 1`] = `
156
- "<!-- wp:heading -->
157
- <h2>one</h2>
158
- <!-- /wp:heading -->
159
-
160
- <!-- wp:quote -->
161
- <blockquote class=\\"wp-block-quote\\"><p>two</p><p>three</p></blockquote>
115
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
116
+ <p>1</p>
117
+ <!-- /wp:paragraph --></blockquote>
162
118
  <!-- /wp:quote -->"
163
119
  `;
164
-
165
- exports[`Quote is transformed to a heading if the quote just contains one paragraph 1`] = `
166
- "<!-- wp:heading -->
167
- <h2>one</h2>
168
- <!-- /wp:heading -->"
169
- `;
170
-
171
- exports[`Quote is transformed to an empty heading if the quote is empty 1`] = `
172
- "<!-- wp:heading -->
173
- <h2></h2>
174
- <!-- /wp:heading -->"
175
- `;
176
-
177
- exports[`Quote the resuling quote after transforming to a heading can be transformed again 1`] = `
178
- "<!-- wp:heading -->
179
- <h2>one</h2>
180
- <!-- /wp:heading -->
181
-
182
- <!-- wp:quote -->
183
- <blockquote class=\\"wp-block-quote\\"><p>two</p><cite>cite</cite></blockquote>
184
- <!-- /wp:quote -->"
185
- `;
186
-
187
- exports[`Quote the resuling quote after transforming to a heading can be transformed again 2`] = `
188
- "<!-- wp:heading -->
189
- <h2>one</h2>
190
- <!-- /wp:heading -->
191
-
192
- <!-- wp:heading -->
193
- <h2>two</h2>
194
- <!-- /wp:heading -->
195
-
196
- <!-- wp:quote -->
197
- <blockquote class=\\"wp-block-quote\\"><p></p><cite>cite</cite></blockquote>
198
- <!-- /wp:quote -->"
199
- `;
200
-
201
- exports[`Quote the resuling quote after transforming to a heading can be transformed again 3`] = `
202
- "<!-- wp:heading -->
203
- <h2>one</h2>
204
- <!-- /wp:heading -->
205
-
206
- <!-- wp:heading -->
207
- <h2>two</h2>
208
- <!-- /wp:heading -->
209
-
210
- <!-- wp:heading -->
211
- <h2>cite</h2>
212
- <!-- /wp:heading -->"
213
- `;
@@ -103,7 +103,7 @@ describe( 'Gallery', () => {
103
103
  // This xpath selects the anchor node for the block which has a child span which contains the text
104
104
  // label of the block and then selects the expander span for that node.
105
105
  const galleryExpander = await page.waitForXPath(
106
- `//a[span[text()='Gallery']]/span[contains(@class, 'block-editor-list-view__expander')]`
106
+ `//a[.//span[text()='Gallery']]/span[contains(@class, 'block-editor-list-view__expander')]`
107
107
  );
108
108
 
109
109
  await galleryExpander.click();
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { uniqueId } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -48,6 +43,7 @@ const REST_PAGES_ROUTES = [
48
43
  '/wp/v2/pages',
49
44
  `rest_route=${ encodeURIComponent( '/wp/v2/pages' ) }`,
50
45
  ];
46
+ let uniqueId = 0;
51
47
 
52
48
  /**
53
49
  * Determines if a given URL matches any of a given collection of
@@ -312,7 +308,7 @@ async function waitForBlock( blockName ) {
312
308
  // Disable reason - these tests are to be re-written.
313
309
  // eslint-disable-next-line jest/no-disabled-tests
314
310
  describe( 'Navigation', () => {
315
- const contributorUsername = uniqueId( 'contributoruser_' );
311
+ const contributorUsername = `contributoruser_${ ++uniqueId }`;
316
312
  let contributorPassword;
317
313
 
318
314
  beforeAll( async () => {
@@ -388,7 +384,10 @@ describe( 'Navigation', () => {
388
384
  expect( loadingSpinner ).toBeNull();
389
385
  } );
390
386
 
391
- it( 'shows a loading indicator whilst ref resolves to Navigation post items', async () => {
387
+ // Skip reason: This test is quite flaky recently.
388
+ // See https://github.com/WordPress/gutenberg/issues/39231.
389
+ // eslint-disable-next-line jest/no-disabled-tests
390
+ it.skip( 'shows a loading indicator whilst ref resolves to Navigation post items', async () => {
392
391
  const testNavId = 1;
393
392
 
394
393
  let resolveNavigationRequest;
@@ -400,11 +399,8 @@ describe( 'Navigation', () => {
400
399
  await setUpResponseMocking( [
401
400
  {
402
401
  match: ( request ) => {
403
- return (
404
- [ 'GET', 'OPTIONS' ].includes( request.method() ) &&
405
- decodeURIComponent( request.url() ).includes(
406
- `navigation/${ testNavId }`
407
- )
402
+ return decodeURIComponent( request.url() ).includes(
403
+ `navigation/`
408
404
  );
409
405
  },
410
406
  onRequestMatch: ( request ) => {
@@ -1051,7 +1047,7 @@ Expected mock function not to be called but it was called with: ["POST", "http:/
1051
1047
  await openListView();
1052
1048
 
1053
1049
  const navExpander = await page.waitForXPath(
1054
- `//a[span[text()='Navigation']]/span[contains(@class, 'block-editor-list-view__expander')]`
1050
+ `//a[.//span[text()='Navigation']]/span[contains(@class, 'block-editor-list-view__expander')]`
1055
1051
  );
1056
1052
 
1057
1053
  await navExpander.click();
@@ -1321,45 +1317,10 @@ Expected mock function not to be called but it was called with: ["POST", "http:/
1321
1317
  await switchUserToAdmin();
1322
1318
  } );
1323
1319
 
1324
- it( 'shows a warning if user does not have permission to edit or update navigation menus', async () => {
1325
- await createNewPost();
1326
- await insertBlock( 'Navigation' );
1327
-
1328
- const startEmptyButton = await page.waitForXPath(
1329
- START_EMPTY_XPATH
1330
- );
1331
-
1332
- // This creates an empty Navigation post type entity.
1333
- await startEmptyButton.click();
1334
-
1335
- // Publishing the Post ensures the Navigation entity is saved.
1336
- // The Post itself is irrelevant.
1337
- await publishPost();
1338
-
1339
- // Switch to a Contributor role user - they should not have
1340
- // permission to update Navigation menus.
1341
- await loginUser( contributorUsername, contributorPassword );
1342
-
1343
- await createNewPost();
1344
-
1345
- // At this point the block will automatically pick the first Navigation Menu
1346
- // which will be the one created by the Admin User.
1347
- await insertBlock( 'Navigation' );
1348
-
1349
- // Make sure the snackbar error shows up.
1350
- await page.waitForXPath(
1351
- `//*[contains(@class, 'components-snackbar__content')][ text()="You do not have permission to edit this Menu. Any changes made will not be saved." ]`
1352
- );
1353
-
1354
- // Expect a console 403 for requests to:
1355
- // * /wp/v2/settings?_locale=user
1356
- // * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user
1357
- expect( console ).toHaveErrored();
1358
- } );
1359
-
1360
- it( 'shows a warning if user does not have permission to create navigation menus', async () => {
1320
+ it.skip( 'shows a warning if user does not have permission to create navigation menus', async () => {
1361
1321
  const noticeText =
1362
1322
  'You do not have permission to create Navigation Menus.';
1323
+
1363
1324
  // Switch to a Contributor role user - they should not have
1364
1325
  // permission to update Navigations.
1365
1326
  await loginUser( contributorUsername, contributorPassword );
@@ -77,7 +77,9 @@ describe( 'Quote', () => {
77
77
  await page.keyboard.type( 'one' );
78
78
  await page.keyboard.press( 'Enter' );
79
79
  await page.keyboard.type( 'two' );
80
- await transformBlockTo( 'Paragraph' );
80
+ // Navigate to the citation to select the block.
81
+ await page.keyboard.press( 'ArrowRight' );
82
+ await transformBlockTo( 'Unwrap' );
81
83
 
82
84
  expect( await getEditedPostContent() ).toMatchSnapshot();
83
85
  } );
@@ -89,7 +91,7 @@ describe( 'Quote', () => {
89
91
  await page.keyboard.type( 'two' );
90
92
  await page.keyboard.press( 'ArrowRight' );
91
93
  await page.keyboard.type( 'cite' );
92
- await transformBlockTo( 'Paragraph' );
94
+ await transformBlockTo( 'Unwrap' );
93
95
 
94
96
  expect( await getEditedPostContent() ).toMatchSnapshot();
95
97
  } );
@@ -98,14 +100,15 @@ describe( 'Quote', () => {
98
100
  await insertBlock( 'Quote' );
99
101
  await page.keyboard.press( 'ArrowRight' );
100
102
  await page.keyboard.type( 'cite' );
101
- await transformBlockTo( 'Paragraph' );
103
+ await transformBlockTo( 'Unwrap' );
102
104
 
103
105
  expect( await getEditedPostContent() ).toMatchSnapshot();
104
106
  } );
105
107
 
106
108
  it( 'and renders a void paragraph if both the cite and quote are void', async () => {
107
109
  await insertBlock( 'Quote' );
108
- await transformBlockTo( 'Paragraph' );
110
+ await page.keyboard.press( 'ArrowRight' ); // Select the quote
111
+ await transformBlockTo( 'Unwrap' );
109
112
 
110
113
  expect( await getEditedPostContent() ).toMatchSnapshot();
111
114
  } );
@@ -119,56 +122,6 @@ describe( 'Quote', () => {
119
122
  expect( await getEditedPostContent() ).toMatchSnapshot();
120
123
  } );
121
124
 
122
- it( 'is transformed to an empty heading if the quote is empty', async () => {
123
- await insertBlock( 'Quote' );
124
- await transformBlockTo( 'Heading' );
125
- expect( await getEditedPostContent() ).toMatchSnapshot();
126
- } );
127
-
128
- it( 'is transformed to a heading if the quote just contains one paragraph', async () => {
129
- await insertBlock( 'Quote' );
130
- await page.keyboard.type( 'one' );
131
- await transformBlockTo( 'Heading' );
132
- expect( await getEditedPostContent() ).toMatchSnapshot();
133
- } );
134
-
135
- it( 'is transformed to a heading and a quote if the quote contains multiple paragraphs', async () => {
136
- await insertBlock( 'Quote' );
137
- await page.keyboard.type( 'one' );
138
- await page.keyboard.press( 'Enter' );
139
- await page.keyboard.type( 'two' );
140
- await page.keyboard.press( 'Enter' );
141
- await page.keyboard.type( 'three' );
142
- await transformBlockTo( 'Heading' );
143
- expect( await getEditedPostContent() ).toMatchSnapshot();
144
- } );
145
-
146
- it( 'is transformed to a heading and a quote if the quote contains a citation', async () => {
147
- await insertBlock( 'Quote' );
148
- await page.keyboard.type( 'one' );
149
- await page.keyboard.press( 'ArrowRight' );
150
- await page.keyboard.type( 'cite' );
151
- await transformBlockTo( 'Heading' );
152
- expect( await getEditedPostContent() ).toMatchSnapshot();
153
- } );
154
-
155
- it( 'the resuling quote after transforming to a heading can be transformed again', async () => {
156
- await insertBlock( 'Quote' );
157
- await page.keyboard.type( 'one' );
158
- await page.keyboard.press( 'Enter' );
159
- await page.keyboard.type( 'two' );
160
- await page.keyboard.press( 'ArrowRight' );
161
- await page.keyboard.type( 'cite' );
162
- await transformBlockTo( 'Heading' );
163
- expect( await getEditedPostContent() ).toMatchSnapshot();
164
- await page.click( '[data-type="core/quote"]' );
165
- await transformBlockTo( 'Heading' );
166
- expect( await getEditedPostContent() ).toMatchSnapshot();
167
- await page.click( '[data-type="core/quote"]' );
168
- await transformBlockTo( 'Heading' );
169
- expect( await getEditedPostContent() ).toMatchSnapshot();
170
- } );
171
-
172
125
  it( 'can be converted to a pullquote', async () => {
173
126
  await insertBlock( 'Quote' );
174
127
  await page.keyboard.type( 'one' );
@@ -180,16 +133,7 @@ describe( 'Quote', () => {
180
133
  expect( await getEditedPostContent() ).toMatchSnapshot();
181
134
  } );
182
135
 
183
- it( 'can be merged into from a paragraph', async () => {
184
- await insertBlock( 'Quote' );
185
- await insertBlock( 'Paragraph' );
186
- await page.keyboard.type( 'test' );
187
- await pressKeyTimes( 'ArrowLeft', 'test'.length );
188
- await page.keyboard.press( 'Backspace' );
189
- expect( await getEditedPostContent() ).toMatchSnapshot();
190
- } );
191
-
192
- it( 'can be split at the end and merged back', async () => {
136
+ it( 'can be split at the end', async () => {
193
137
  await insertBlock( 'Quote' );
194
138
  await page.keyboard.type( '1' );
195
139
  await page.keyboard.press( 'Enter' );
@@ -200,46 +144,7 @@ describe( 'Quote', () => {
200
144
 
201
145
  await page.keyboard.press( 'Backspace' );
202
146
 
203
- // Expect empty paragraph inside quote block.
204
- expect( await getEditedPostContent() ).toMatchSnapshot();
205
-
206
- await page.keyboard.press( 'Backspace' );
207
-
208
- // Expect quote without empty paragraphs.
209
- expect( await getEditedPostContent() ).toMatchSnapshot();
210
- } );
211
-
212
- it( 'can be split in the middle and merged back', async () => {
213
- await insertBlock( 'Quote' );
214
- await page.keyboard.type( '1' );
215
- await page.keyboard.press( 'Enter' );
216
- await page.keyboard.type( '2' );
217
- await page.keyboard.press( 'ArrowRight' );
218
- await page.keyboard.type( 'c' );
219
- await page.keyboard.press( 'ArrowUp' );
220
- await page.keyboard.press( 'ArrowUp' );
221
- await page.keyboard.press( 'Enter' );
222
- await page.keyboard.press( 'Enter' );
223
-
224
- // Expect two quote blocks and empty paragraph in the middle.
225
- expect( await getEditedPostContent() ).toMatchSnapshot();
226
-
227
- await page.keyboard.press( 'Backspace' );
228
-
229
- // Expect two quote blocks and empty paragraph in the first quote.
230
- expect( await getEditedPostContent() ).toMatchSnapshot();
231
-
232
- await page.keyboard.press( 'Backspace' );
233
-
234
- // Expect two quote blocks.
235
- expect( await getEditedPostContent() ).toMatchSnapshot();
236
-
237
- await page.keyboard.press( 'ArrowLeft' );
238
- await page.keyboard.press( 'ArrowDown' );
239
- await page.keyboard.press( 'ArrowDown' );
240
- await page.keyboard.press( 'ArrowDown' );
241
- await page.keyboard.press( 'Backspace' );
242
-
147
+ // Expect the paragraph to be deleted.
243
148
  expect( await getEditedPostContent() ).toMatchSnapshot();
244
149
  } );
245
150
  } );
@@ -10,7 +10,9 @@ exports[`cpt locking template_lock all should insert line breaks when using ente
10
10
  <!-- /wp:paragraph -->
11
11
 
12
12
  <!-- wp:quote -->
13
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
13
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
14
+ <p></p>
15
+ <!-- /wp:paragraph --></blockquote>
14
16
  <!-- /wp:quote -->
15
17
 
16
18
  <!-- wp:columns -->
@@ -28,7 +30,9 @@ exports[`cpt locking template_lock all should not error when deleting the cotent
28
30
  <!-- /wp:paragraph -->
29
31
 
30
32
  <!-- wp:quote -->
31
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
33
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
34
+ <p></p>
35
+ <!-- /wp:paragraph --></blockquote>
32
36
  <!-- /wp:quote -->
33
37
 
34
38
  <!-- wp:columns -->
@@ -43,7 +47,9 @@ exports[`cpt locking template_lock all unlocked group should allow blocks to be
43
47
  <!-- /wp:paragraph -->
44
48
 
45
49
  <!-- wp:quote -->
46
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
50
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
51
+ <p></p>
52
+ <!-- /wp:paragraph --></blockquote>
47
53
  <!-- /wp:quote --></div>
48
54
  <!-- /wp:group -->"
49
55
  `;
@@ -51,7 +57,9 @@ exports[`cpt locking template_lock all unlocked group should allow blocks to be
51
57
  exports[`cpt locking template_lock all unlocked group should allow blocks to be removed 1`] = `
52
58
  "<!-- wp:group {\\"templateLock\\":false} -->
53
59
  <div class=\\"wp-block-group\\"><!-- wp:quote -->
54
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
60
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
61
+ <p></p>
62
+ <!-- /wp:paragraph --></blockquote>
55
63
  <!-- /wp:quote --></div>
56
64
  <!-- /wp:group -->"
57
65
  `;
@@ -66,7 +74,9 @@ exports[`cpt locking template_lock false should allow blocks to be inserted 1`]
66
74
  <!-- /wp:paragraph -->
67
75
 
68
76
  <!-- wp:quote -->
69
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
77
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
78
+ <p></p>
79
+ <!-- /wp:paragraph --></blockquote>
70
80
  <!-- /wp:quote -->
71
81
 
72
82
  <!-- wp:columns -->
@@ -88,7 +98,9 @@ exports[`cpt locking template_lock false should allow blocks to be moved 1`] = `
88
98
  <!-- /wp:image -->
89
99
 
90
100
  <!-- wp:quote -->
91
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
101
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
102
+ <p></p>
103
+ <!-- /wp:paragraph --></blockquote>
92
104
  <!-- /wp:quote -->
93
105
 
94
106
  <!-- wp:columns -->
@@ -102,7 +114,9 @@ exports[`cpt locking template_lock false should allow blocks to be removed 1`] =
102
114
  <!-- /wp:image -->
103
115
 
104
116
  <!-- wp:quote -->
105
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
117
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
118
+ <p></p>
119
+ <!-- /wp:paragraph --></blockquote>
106
120
  <!-- /wp:quote -->
107
121
 
108
122
  <!-- wp:columns -->
@@ -120,7 +134,9 @@ exports[`cpt locking template_lock insert should allow blocks to be moved 1`] =
120
134
  <!-- /wp:image -->
121
135
 
122
136
  <!-- wp:quote -->
123
- <blockquote class=\\"wp-block-quote\\"><p></p></blockquote>
137
+ <blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
138
+ <p></p>
139
+ <!-- /wp:paragraph --></blockquote>
124
140
  <!-- /wp:quote -->
125
141
 
126
142
  <!-- wp:columns -->