Skip to content

Commit

Permalink
check toolbar alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed Oct 9, 2024
1 parent 82011cc commit 86e8621
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,27 @@ test.describe( 'Zoom Out', () => {
} ) => {
await page.getByLabel( 'Zoom Out' ).click();

//Click on the first pattern of the theme
await editor.canvas
const firstPattern = editor.canvas
.locator( 'div' )
.filter( { hasText: 'A commitment to innovation' } )
.nth( 1 )
.click();
.nth( 1 );

//Click on the first pattern of the theme
await firstPattern.click();

const toolbar = page.getByRole( 'toolbar', {
name: 'Block tools',
} );

await expect( toolbar ).toBeVisible();

await expect(
page.getByRole( 'toolbar', { name: 'Block tools' } )
).toBeVisible();
const toolbarRect = await toolbar.boundingBox();
const firstPatternRect = await firstPattern.boundingBox();

//Check that the toolbar is vertically aligned to the pattern and to the left
expect( toolbarRect.y ).toEqual( firstPatternRect.y );
expect( toolbarRect.x + toolbarRect.width ).toEqual(
firstPatternRect.x
);
} );
} );

0 comments on commit 86e8621

Please sign in to comment.