@wordpress/e2e-tests 2.5.15 → 2.5.16

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.15",
3
+ "version": "2.5.16",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -26,7 +26,7 @@
26
26
  "@wordpress/e2e-test-utils": "^5.4.10",
27
27
  "@wordpress/jest-console": "^4.1.1",
28
28
  "@wordpress/jest-puppeteer-axe": "^3.1.1",
29
- "@wordpress/scripts": "^19.2.3",
29
+ "@wordpress/scripts": "^19.2.4",
30
30
  "@wordpress/url": "^3.3.1",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "2cefc3c6ce6a1cbfb7e52c872c9efbaded0bbb91"
46
+ "gitHead": "8c2cd6a5fd8781266da858a2e7d1bdd9a3a279e4"
47
47
  }
@@ -57,11 +57,5 @@ describe( 'iframed inline styles', () => {
57
57
  expect( await getComputedStyle( canvas(), 'border-width' ) ).toBe(
58
58
  '2px'
59
59
  );
60
-
61
- expect( console ).toHaveWarned(
62
- `Stylesheet iframed-inline-styles-compat-style-css was not properly added.
63
- For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
64
- For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles). <link rel="stylesheet" id="iframed-inline-styles-compat-style-css" href="http://localhost:8889/wp-content/plugins/gutenberg-test-plugins/iframed-inline-styles/compat-style.css?ver=1626189899" media="all">`
65
- );
66
60
  } );
67
61
  } );
@@ -63,9 +63,5 @@ describe( 'iframed multiple block stylesheets', () => {
63
63
  expect( await getComputedStyle( canvas(), 'background-color' ) ).toBe(
64
64
  'rgb(0, 0, 0)'
65
65
  );
66
-
67
- // Skip warnings related to block-styles enqueing and the use of add_editor_style.
68
- // The issue is tracked on https://github.com/WordPress/gutenberg/issues/33212.
69
- expect( console ).toHaveWarned();
70
66
  } );
71
67
  } );
@@ -18,10 +18,6 @@ import {
18
18
  // eslint-disable-next-line no-restricted-imports
19
19
  import { find, findAll } from 'puppeteer-testing-library';
20
20
 
21
- const twentyTwentyError = `Stylesheet twentytwenty-block-editor-styles-css was not properly added.
22
- For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
23
- For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles).`;
24
-
25
21
  describe( 'Widgets Customizer', () => {
26
22
  beforeEach( async () => {
27
23
  await deleteAllWidgets();
@@ -162,8 +158,6 @@ describe( 'Widgets Customizer', () => {
162
158
  name: 'My Search',
163
159
  selector: '.widget-content *',
164
160
  } ).toBeFound( findOptions );
165
-
166
- expect( console ).toHaveWarned( twentyTwentyError );
167
161
  } );
168
162
 
169
163
  it( 'should open the inspector panel', async () => {
@@ -249,8 +243,6 @@ describe( 'Widgets Customizer', () => {
249
243
  } ).toBeFound();
250
244
 
251
245
  await expect( inspectorHeading ).not.toBeVisible();
252
-
253
- expect( console ).toHaveWarned( twentyTwentyError );
254
246
  } );
255
247
 
256
248
  it( 'should handle the inserter outer section', async () => {
@@ -358,8 +350,6 @@ describe( 'Widgets Customizer', () => {
358
350
  name: 'Add a block',
359
351
  level: 2,
360
352
  } ).not.toBeFound();
361
-
362
- expect( console ).toHaveWarned( twentyTwentyError );
363
353
  } );
364
354
 
365
355
  it( 'should move focus to the block', async () => {
@@ -455,8 +445,6 @@ describe( 'Widgets Customizer', () => {
455
445
  text: 'First Heading',
456
446
  } );
457
447
  await expect( headingBlock ).toHaveFocus();
458
-
459
- expect( console ).toHaveWarned( twentyTwentyError );
460
448
  } );
461
449
 
462
450
  it( 'should clear block selection', async () => {
@@ -519,8 +507,6 @@ describe( 'Widgets Customizer', () => {
519
507
  role: 'toolbar',
520
508
  name: 'Block tools',
521
509
  } ).not.toBeFound();
522
-
523
- expect( console ).toHaveWarned( twentyTwentyError );
524
510
  } );
525
511
 
526
512
  it( 'should handle legacy widgets', async () => {
@@ -699,8 +685,6 @@ describe( 'Widgets Customizer', () => {
699
685
  selector: '*[aria-live="polite"][aria-relevant="additions text"]',
700
686
  } ).toBeFound();
701
687
  await expect( paragraphBlock ).toBeVisible();
702
-
703
- expect( console ).toHaveWarned( twentyTwentyError );
704
688
  } );
705
689
 
706
690
  it( 'should move (inner) blocks to another sidebar', async () => {
@@ -760,8 +744,6 @@ describe( 'Widgets Customizer', () => {
760
744
  await expect( movedParagraphBlockQuery ).toBeFound();
761
745
  const movedParagraphBlock = await find( movedParagraphBlockQuery );
762
746
  await expect( movedParagraphBlock ).toHaveFocus();
763
-
764
- expect( console ).toHaveWarned( twentyTwentyError );
765
747
  } );
766
748
 
767
749
  it( 'should not render Block Settings sections', async () => {
@@ -851,8 +833,6 @@ describe( 'Widgets Customizer', () => {
851
833
  name: 'Customizing ▸ Widgets ▸ Footer #1 Block Settings',
852
834
  level: 3,
853
835
  } );
854
-
855
- expect( console ).toHaveWarned( twentyTwentyError );
856
836
  } );
857
837
  } );
858
838
 
@@ -16,6 +16,7 @@ import {
16
16
  openGlobalBlockInserter,
17
17
  searchForBlock,
18
18
  closeGlobalBlockInserter,
19
+ setBrowserViewport,
19
20
  } from '@wordpress/e2e-test-utils';
20
21
 
21
22
  /**
@@ -25,10 +26,6 @@ import {
25
26
  import { find, findAll } from 'puppeteer-testing-library';
26
27
  import { groupBy, mapValues } from 'lodash';
27
28
 
28
- const twentyTwentyError = `Stylesheet twentytwenty-block-editor-styles-css was not properly added.
29
- For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
30
- For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles).`;
31
-
32
29
  describe( 'Widgets screen', () => {
33
30
  beforeEach( async () => {
34
31
  await visitWidgetsScreen();
@@ -232,8 +229,6 @@ describe( 'Widgets screen', () => {
232
229
  </div></div>",
233
230
  }
234
231
  ` );
235
-
236
- expect( console ).toHaveWarned( twentyTwentyError );
237
232
  } );
238
233
 
239
234
  it.skip( 'Should insert content using the inline inserter', async () => {
@@ -601,8 +596,6 @@ describe( 'Widgets screen', () => {
601
596
  initialSerializedWidgetAreas[ 'sidebar-1' ],
602
597
  ].join( '\n' )
603
598
  );
604
-
605
- expect( console ).toHaveWarned( twentyTwentyError );
606
599
  } );
607
600
 
608
601
  it.skip( 'Should display legacy widgets', async () => {
@@ -777,8 +770,6 @@ describe( 'Widgets screen', () => {
777
770
  </div></div>",
778
771
  }
779
772
  ` );
780
-
781
- expect( console ).toHaveWarned( twentyTwentyError );
782
773
  } );
783
774
 
784
775
  it( 'Allows widget deletion to be undone', async () => {
@@ -838,8 +829,6 @@ describe( 'Widgets screen', () => {
838
829
  </div></div>",
839
830
  }
840
831
  ` );
841
-
842
- expect( console ).toHaveWarned( twentyTwentyError );
843
832
  } );
844
833
 
845
834
  it( 'can toggle sidebar list view', async () => {
@@ -854,6 +843,41 @@ describe( 'Widgets screen', () => {
854
843
  expect( listItems.length >= widgetAreas.length ).toEqual( true );
855
844
  await closeListView();
856
845
  } );
846
+
847
+ // Check for regressions of https://github.com/WordPress/gutenberg/issues/38002.
848
+ it( 'allows blocks to be added on mobile viewports', async () => {
849
+ await setBrowserViewport( 'small' );
850
+ const [ firstWidgetArea ] = await findAll( {
851
+ role: 'document',
852
+ name: 'Block: Widget Area',
853
+ } );
854
+
855
+ const addParagraphBlock = await getBlockInGlobalInserter( 'Paragraph' );
856
+ await addParagraphBlock.click();
857
+
858
+ const addedParagraphBlockInFirstWidgetArea = await find(
859
+ {
860
+ name: /^Empty block/,
861
+ selector: '[data-block][data-type="core/paragraph"]',
862
+ },
863
+ {
864
+ root: firstWidgetArea,
865
+ }
866
+ );
867
+ await addedParagraphBlockInFirstWidgetArea.focus();
868
+ await page.keyboard.type( 'First Paragraph' );
869
+ const updatedParagraphBlockInFirstWidgetArea = await find(
870
+ {
871
+ name: 'Paragraph block',
872
+ value: 'First Paragraph',
873
+ },
874
+ {
875
+ root: firstWidgetArea,
876
+ }
877
+ );
878
+
879
+ expect( updatedParagraphBlockInFirstWidgetArea ).toBeTruthy();
880
+ } );
857
881
  } );
858
882
 
859
883
  /**