Skip to content

Commit

Permalink
check the size of the iframe after scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Oct 8, 2024
1 parent 3b743c4 commit 0880ea0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ test.describe( 'Zoom Out', () => {
editor,
} ) => {
await page.getByLabel( 'Zoom Out' ).click();
const frame = editor.canvas.locator( 'html' );
await expect( frame ).toHaveCSS(
const iframe = page.locator( 'iframe[name="editor-canvas"]' );
const html = editor.canvas.locator( 'html' );

//Check that the html is scaled
await expect( html ).toHaveCSS(
'transform',
'matrix(0.75, 0, 0, 0.75, 0, 0)'
);
await page.pause();
const iframeRect = await iframe.boundingBox();
const htmlRect = await html.boundingBox();

//Check that the iframe is larger than the html
expect( iframeRect.width ).toBeGreaterThan( htmlRect.width );
} );
} );

0 comments on commit 0880ea0

Please sign in to comment.