@wordpress/e2e-tests 4.0.3 → 4.0.4

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": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "37e930b93fbba88fa024a91eb527a90f855c97f3"
49
+ "gitHead": "1fdd4758150247d6b690051aed18fa27c15f3a32"
50
50
  }
@@ -10,6 +10,7 @@ import {
10
10
  clickBlockToolbarButton,
11
11
  clickButton,
12
12
  clickMenuItem,
13
+ insertBlock,
13
14
  openListView,
14
15
  saveDraft,
15
16
  transformBlockTo,
@@ -975,4 +976,51 @@ describe( 'Multi-block selection', () => {
975
976
  // Expect two blocks with "&" in between.
976
977
  expect( await getEditedPostContent() ).toMatchSnapshot();
977
978
  } );
979
+ describe( 'shift+click multi-selection', () => {
980
+ it( 'should multi-select block with text selection and a block without text selection', async () => {
981
+ await page.keyboard.press( 'Enter' );
982
+ await page.keyboard.type( 'hi' );
983
+ await page.keyboard.press( 'Enter' );
984
+ await insertBlock( 'Spacer' );
985
+ await page.keyboard.press( 'ArrowUp' );
986
+
987
+ const spacerBlock = await page.waitForSelector(
988
+ '.wp-block.wp-block-spacer'
989
+ );
990
+ const boundingBox = await spacerBlock.boundingBox();
991
+ const mousePosition = {
992
+ x: boundingBox.x + boundingBox.width / 2,
993
+ y: boundingBox.y + boundingBox.height / 2,
994
+ };
995
+ await page.keyboard.down( 'Shift' );
996
+ await page.mouse.click( mousePosition.x, mousePosition.y );
997
+ await page.keyboard.up( 'Shift' );
998
+
999
+ const selectedBlocks = await page.$$(
1000
+ '.wp-block.is-multi-selected'
1001
+ );
1002
+ expect( selectedBlocks.length ).toBe( 2 );
1003
+ } );
1004
+ it( 'should multi-select blocks without text selection', async () => {
1005
+ await insertBlock( 'Spacer' );
1006
+ // Get the first spacer block element.
1007
+ const spacerBlock = await page.waitForSelector(
1008
+ '.wp-block.wp-block-spacer'
1009
+ );
1010
+ const boundingBox = await spacerBlock.boundingBox();
1011
+ await page.keyboard.press( 'Enter' );
1012
+ await insertBlock( 'Spacer' );
1013
+ const mousePosition = {
1014
+ x: boundingBox.x + boundingBox.width / 2,
1015
+ y: boundingBox.y + boundingBox.height / 2,
1016
+ };
1017
+ await page.keyboard.down( 'Shift' );
1018
+ await page.mouse.click( mousePosition.x, mousePosition.y );
1019
+ await page.keyboard.up( 'Shift' );
1020
+ const selectedBlocks = await page.$$(
1021
+ '.wp-block.is-multi-selected'
1022
+ );
1023
+ expect( selectedBlocks.length ).toBe( 2 );
1024
+ } );
1025
+ } );
978
1026
  } );