@wordpress/e2e-tests 2.5.11 → 2.5.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "2.5.11",
3
+ "version": "2.5.12",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "3826b68f8c5b5026b318463af647f6fb19b534d2"
46
+ "gitHead": "3665e3e1b121046300d8b2fa35074d748f16dbc2"
47
47
  }
@@ -110,6 +110,52 @@ describe( 'Block Grouping', () => {
110
110
  );
111
111
  expect( ungroupButtons ).toHaveLength( 0 );
112
112
  } );
113
+ it( 'should group and ungroup a controlled block properly', async () => {
114
+ const getParagraphText = async () => {
115
+ const paragraphInReusableSelector =
116
+ '.block-editor-block-list__block[data-type="core/block"] p';
117
+ await page.waitForSelector( paragraphInReusableSelector );
118
+ return page.$eval(
119
+ paragraphInReusableSelector,
120
+ ( element ) => element.innerText
121
+ );
122
+ };
123
+
124
+ const paragraphText = 'hi';
125
+ const reusableBlockNameInputSelector =
126
+ '.reusable-blocks-menu-items__convert-modal .components-text-control__input';
127
+ await insertBlock( 'Paragraph' );
128
+ await page.keyboard.type( paragraphText );
129
+
130
+ await clickBlockToolbarButton( 'Options' );
131
+ await clickMenuItem( 'Add to Reusable blocks' );
132
+ const nameInput = await page.waitForSelector(
133
+ reusableBlockNameInputSelector
134
+ );
135
+ await nameInput.click();
136
+ await page.keyboard.type( 'Block' );
137
+ await page.keyboard.press( 'Enter' );
138
+
139
+ // Wait for creation to finish
140
+ await page.waitForXPath(
141
+ '//*[contains(@class, "components-snackbar")]/*[text()="Reusable block created."]'
142
+ );
143
+ // Group
144
+ await clickBlockToolbarButton( 'Options' );
145
+ await clickMenuItem( 'Group' );
146
+
147
+ let group = await page.$$( '[data-type="core/group"]' );
148
+ expect( group ).toHaveLength( 1 );
149
+ // Make sure the paragraph in reusable block exists.
150
+ expect( await getParagraphText() ).toMatch( paragraphText );
151
+
152
+ await clickBlockToolbarButton( 'Options' );
153
+ await clickMenuItem( 'Ungroup' );
154
+ group = await page.$$( '[data-type="core/group"]' );
155
+ expect( group ).toHaveLength( 0 );
156
+ // Make sure the paragraph in reusable block exists.
157
+ expect( await getParagraphText() ).toEqual( paragraphText );
158
+ } );
113
159
  } );
114
160
 
115
161
  describe( 'Grouping Block availability', () => {