From 82c440dc5c1e0d2caaf00b442d341e8d3dd80bbe Mon Sep 17 00:00:00 2001 From: himanshupathak95 Date: Fri, 7 Feb 2025 14:20:25 +0530 Subject: [PATCH] E2E: Add test for columns block template lock removal restriction --- .../editor/plugins/post-type-locking.spec.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/e2e/specs/editor/plugins/post-type-locking.spec.js b/test/e2e/specs/editor/plugins/post-type-locking.spec.js index ff02d18c51464b..65982838a71c46 100644 --- a/test/e2e/specs/editor/plugins/post-type-locking.spec.js +++ b/test/e2e/specs/editor/plugins/post-type-locking.spec.js @@ -462,4 +462,27 @@ test.describe( 'Post-type locking', () => { ).toBeHidden(); } ); } ); + + test.describe( 'template_lock for columns block', () => { + test.beforeEach( async ( { admin } ) => { + await admin.createNewPost( { postType: 'locked-all-post' } ); + } ); + + test( 'should not allow changing number of columns or column operations', async ( { + editor, + page, + } ) => { + const columnsBlock = editor.canvas.getByRole( 'document', { + name: 'Block: Columns', + } ); + await columnsBlock.click(); + + await editor.clickBlockToolbarButton( 'Options' ); + await expect( + page + .getByRole( 'menu', { name: 'Options' } ) + .getByRole( 'menuitem', { name: 'Delete' } ) + ).toBeHidden(); + } ); + } ); } );