Skip to content

Commit

Permalink
Add a regression e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Aug 19, 2022
1 parent 7cb664e commit 7bee808
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/e2e/specs/site-editor/template-part.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,34 @@ test.describe( 'Template Part', () => {

await expect( paragraph ).toBeVisible();
} );

// Check for regressions of https://github.com/WordPress/gutenberg/issues/42226.
test( 'has an editor with a resizable box and iframe height that matches the content height', async ( {
admin,
editor,
page,
} ) => {
await admin.visitSiteEditor( {
postId: 'emptytheme//header',
postType: 'wp_template_part',
} );

// Ensure content has loaded before testing heights.
await editor.canvas.waitForLoadState( 'networkidle' );

const blockList = editor.canvas.locator(
'.edit-site-block-editor__block-list'
);
const iframe = await editor.canvas.frameElement();
const resizableBox = page.locator(
'.components-resizable-box__container'
);

const blockListRect = await blockList.boundingBox();
const iframeRect = await iframe.boundingBox();
const resizableBoxRect = await resizableBox.boundingBox();

expect( iframeRect.height ).toBe( blockListRect.height );
expect( resizableBoxRect.height ).toBe( blockListRect.height );
} );
} );

0 comments on commit 7bee808

Please sign in to comment.