From a865b92683bad791b50789c3b2bf1c17006de3c6 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 10 Jun 2021 12:43:19 +0100 Subject: [PATCH] Fix remaining e2e test failure --- .../e2e-tests/specs/editor/plugins/templates.test.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/e2e-tests/specs/editor/plugins/templates.test.js b/packages/e2e-tests/specs/editor/plugins/templates.test.js index b1c2491a301fa9..bf3ad53256d90a 100644 --- a/packages/e2e-tests/specs/editor/plugins/templates.test.js +++ b/packages/e2e-tests/specs/editor/plugins/templates.test.js @@ -102,16 +102,15 @@ describe( 'templates', () => { await page.type( '.editor-post-title__input', 'My Image Format' ); await clickBlockAppender(); await page.keyboard.press( 'Backspace' ); + // Wait for the selection to update. + await page.evaluate( + () => new Promise( window.requestAnimationFrame ) + ); await page.keyboard.press( 'Backspace' ); await saveDraft(); await page.reload(); await page.waitForSelector( '.edit-post-layout' ); - // Wait a bit more for getEditedPostContent to be correct - await page.waitForSelector( - '.block-editor-default-block-appender__content' - ); - expect( await getEditedPostContent() ).toMatchSnapshot(); } );