Skip to content

Commit

Permalink
e2e test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
karthick-murugan committed Feb 7, 2025
1 parent 7bd4c9e commit 944446c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/e2e/specs/editor/various/patterns.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,36 +587,39 @@ test.describe( 'Synced pattern', () => {
} );

// Check for regressions of https://github.com/WordPress/gutenberg/issues/27243.
test( 'should allow a block with styles to be converted to a reusable block', async ( {
test( 'should allow a block to be converted to a reusable block', async ( {
editor,
page,
} ) => {
// Insert the Quote block
await editor.insertBlock( { name: 'core/quote' } );
await editor.saveDraft();
await page.reload();

// Open the document settings sidebar
await editor.openDocumentSettingsSidebar();
await editor.selectBlocks(
editor.canvas.getByRole( 'document', { name: 'Block: Quote' } )
);

await page.click( 'role=menuitem[name="Plain Style"i]' ); // Update the selector based on UI changes.

// Convert the block to a reusable block
await editor.clickBlockOptionsMenuItem( 'Create pattern' );

// Verify the "Create pattern" dialog is visible
const createPatternDialog = editor.page.getByRole( 'dialog', {
name: 'add new pattern',
} );
await createPatternDialog
.getByRole( 'textbox', { name: 'Name' } )
.fill( 'Block with styles' );
.fill( 'Block without styles' );
await createPatternDialog
.getByRole( 'checkbox', { name: 'Synced' } )
.setChecked( true );
await createPatternDialog
.getByRole( 'button', { name: 'Add' } )
.click();

// Verify the pattern block is visible
await expect(
editor.canvas.getByRole( 'document', { name: 'Block: Pattern' } )
).toBeVisible();
Expand Down

0 comments on commit 944446c

Please sign in to comment.