From 1f4e55112e8ea30a38356491b917b86220c9a12d Mon Sep 17 00:00:00 2001 From: Marcelo de Moraes Serpa Date: Tue, 8 Sep 2020 19:29:30 -0500 Subject: [PATCH 1/8] Add regression E2E test for the classic block initialization issue Issue: https://github.com/WordPress/gutenberg/issues/24696 --- .../blocks/__snapshots__/classic.test.js.snap | 4 ++ .../specs/editor/blocks/classic.test.js | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/packages/e2e-tests/specs/editor/blocks/__snapshots__/classic.test.js.snap b/packages/e2e-tests/specs/editor/blocks/__snapshots__/classic.test.js.snap index a4461344bb438..ab5206d54577b 100644 --- a/packages/e2e-tests/specs/editor/blocks/__snapshots__/classic.test.js.snap +++ b/packages/e2e-tests/specs/editor/blocks/__snapshots__/classic.test.js.snap @@ -1,3 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Classic Should not fail after save/reload 1`] = `"test"`; + +exports[`Classic Should not fail after save/reload 2`] = `"test"`; + exports[`Classic should be inserted 1`] = `"test"`; diff --git a/packages/e2e-tests/specs/editor/blocks/classic.test.js b/packages/e2e-tests/specs/editor/blocks/classic.test.js index b9302e3a8217e..ce450cd1720f5 100644 --- a/packages/e2e-tests/specs/editor/blocks/classic.test.js +++ b/packages/e2e-tests/specs/editor/blocks/classic.test.js @@ -15,6 +15,8 @@ import { insertBlock, pressKeyWithModifier, clickBlockToolbarButton, + switchEditorModeTo, + saveDraft, } from '@wordpress/e2e-test-utils'; describe( 'Classic', () => { @@ -46,6 +48,7 @@ describe( 'Classic', () => { // Click the image button. await page.waitForSelector( 'div[aria-label^="Add Media"]' ); await page.click( 'div[aria-label^="Add Media"]' ); + await page.click( '.media-menu-item#menu-item-gallery' ); // Wait for media modal to appear and upload image. @@ -98,4 +101,48 @@ describe( 'Classic', () => { await page.waitForSelector( '.wp-block[data-type="core/gallery"]' ); expect( await getEditedPostContent() ).toMatch( /