Skip to content

Commit

Permalink
Add a test for classic style book
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Dec 10, 2024
1 parent 2dbc13f commit 859de22
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/e2e/specs/site-editor/style-book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 859de22

Please sign in to comment.