Skip to content

Commit

Permalink
fixed test to not use the experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera committed May 9, 2024
1 parent f56517e commit 2771fa0
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/e2e/specs/site-editor/zoom-out.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'Zoom Out', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.activateTheme( 'emptytheme' );
} );

test.beforeEach( async ( { admin, editor } ) => {
await admin.visitSiteEditor();
await editor.canvas.locator( 'body' ).click();
} );

test.afterAll( async ( { requestUtils } ) => {
await requestUtils.activateTheme( 'twentytwentyone' );
} );

test( 'Clicking on inserter while on zoom-out should open the patterns tab on the inserter', async ( {
page,
} ) => {
const zoomOutButton = page.getByRole( 'button', {
name: 'Zoom-out View',
exact: true,
} );
// Trigger zoom out on Global Styles because there the inserter is not open.
await page.getByRole( 'button', { name: 'Styles' } ).click();
await page.getByRole( 'button', { name: 'Browse styles' } ).click();

await zoomOutButton.click();
await expect( page.getByLabel( 'Add pattern' ) ).toHaveCount( 3 );
await page.getByLabel( 'Add pattern' ).first().click();
await expect( page.getByLabel( 'Add pattern' ) ).toHaveCount( 2 );
Expand Down

0 comments on commit 2771fa0

Please sign in to comment.