Skip to content
Prev Previous commit
Next Next commit
Reinstate skipped e2e test - make more reliable by waiting for resize…
… buttons, and by clicking image block wrapper to delete block
  • Loading branch information
Glen Davies committed Nov 30, 2021
commit d751803dcde28f78bafad3b25a025b9ac506398a
8 changes: 6 additions & 2 deletions packages/e2e-tests/specs/editor/blocks/image.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe( 'Image', () => {
expect( await getEditedPostContent() ).toMatch( regex );
} );

it.skip( 'should replace, reset size, and keep selection', async () => {
it( 'should replace, reset size, and keep selection', async () => {
await insertBlock( 'Image' );
const filename1 = await upload( '.wp-block-image input[type="file"]' );
await waitForImage( filename1 );
Expand All @@ -85,6 +85,10 @@ describe( 'Image', () => {
expect( await getEditedPostContent() ).toMatch( regex1 );

await openDocumentSettingsSidebar();
await page.waitForSelector(
'[aria-label="Image size presets"] button:first-child',
{ visible: true }
);
await page.click( '[aria-label="Image size presets"] button' );

const regex2 = new RegExp(
Expand All @@ -104,7 +108,7 @@ describe( 'Image', () => {
);
expect( await getEditedPostContent() ).toMatch( regex3 );

await page.click( '.wp-block-image img' );
await page.click( '.wp-block-image' );
await page.keyboard.press( 'Backspace' );

expect( await getEditedPostContent() ).toBe( '' );
Expand Down