From 12d8e9abd40507ad934d32d6c0afb00b5023d37c Mon Sep 17 00:00:00 2001 From: Maggie Cabrera Date: Thu, 9 May 2024 11:21:38 +0900 Subject: [PATCH] add e2e test --- test/e2e/specs/site-editor/zoom-out.spec.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/e2e/specs/site-editor/zoom-out.spec.js b/test/e2e/specs/site-editor/zoom-out.spec.js index 0a4319440f4ac1..36b040bdc0950d 100644 --- a/test/e2e/specs/site-editor/zoom-out.spec.js +++ b/test/e2e/specs/site-editor/zoom-out.spec.js @@ -61,4 +61,25 @@ test.describe( 'Zoom Out', () => { await expect( zoomOutButton ).toBeFocused(); } ); + + 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, + } ); + + 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 ); + + await expect( + page + .locator( '#tabs-2-allPatterns-view div' ) + .filter( { hasText: 'All' } ) + .nth( 1 ) + ).toBeVisible(); + } ); } );