From 859de22b5d9e01dd282f48f4366b86bb6ac34cbe Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 10 Dec 2024 14:29:22 +1100 Subject: [PATCH] Add a test for classic style book --- test/e2e/specs/site-editor/style-book.spec.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/e2e/specs/site-editor/style-book.spec.js b/test/e2e/specs/site-editor/style-book.spec.js index 38030892826ec7..350b1925385063 100644 --- a/test/e2e/specs/site-editor/style-book.spec.js +++ b/test/e2e/specs/site-editor/style-book.spec.js @@ -189,6 +189,30 @@ test.describe( 'Style Book', () => { } ); } ); +test.describe( 'Style Book for classic themes', () => { + test( 'Should show Style Book for a theme that supports it', async ( { + page, + admin, + requestUtils, + } ) => { + // Make sure a classic theme is active. + await requestUtils.activateTheme( 'twentytwentyone' ); + // Go to site editor. + await admin.visitAdminPage( 'site-editor.php' ); + + // Open the Style Book. + await page.getByRole( 'button', { name: 'Styles' } ).click(); + + // Block examples should be visible. + const blockExamples = page + .frameLocator( '[name="style-book-canvas"]' ) + .getByRole( 'grid', { + name: 'Examples of blocks', + } ); + await expect( blockExamples ).toBeVisible(); + } ); +} ); + class StyleBook { constructor( { page } ) { this.page = page;