From 0880ea0c236ea8f96b2ed014f0c009e583ea89a4 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Tue, 8 Oct 2024 18:52:25 +0200 Subject: [PATCH] check the size of the iframe after scaling --- test/e2e/specs/site-editor/zoom-out.spec.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/e2e/specs/site-editor/zoom-out.spec.js b/test/e2e/specs/site-editor/zoom-out.spec.js index 94ef82dca73b7..904e2762eb974 100644 --- a/test/e2e/specs/site-editor/zoom-out.spec.js +++ b/test/e2e/specs/site-editor/zoom-out.spec.js @@ -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 ); } ); } );