diff --git a/test/e2e/specs/editor/various/post-editor-template-mode.spec.js b/test/e2e/specs/editor/various/post-editor-template-mode.spec.js index f9a7aa8970d3e6..c7aed497dc25cc 100644 --- a/test/e2e/specs/editor/various/post-editor-template-mode.spec.js +++ b/test/e2e/specs/editor/various/post-editor-template-mode.spec.js @@ -102,6 +102,32 @@ test.describe( 'Post Editor Template mode', () => { ).toBeVisible(); } ); + test( 'Allow editing the title of a new custom template', async ( { + page, + postEditorTemplateMode, + } ) => { + async function editTemplateTitle( newTitle ) { + await page + .getByRole( 'button', { name: 'Template Options' } ) + .click(); + + await page + .getByRole( 'textbox', { name: 'Title' } ) + .fill( newTitle ); + + const editorContent = page.getByLabel( 'Editor Content' ); + await editorContent.click(); + } + + await postEditorTemplateMode.createPostAndSaveDraft(); + await postEditorTemplateMode.createNewTemplate( 'Foobar' ); + await editTemplateTitle( 'Barfoo' ); + + await expect( + page.getByRole( 'button', { name: 'Template Options' } ) + ).toHaveText( 'Barfoo' ); + } ); + test.describe( 'Delete Post Template Confirmation Dialog', () => { test.beforeAll( async ( { requestUtils } ) => { await requestUtils.activateTheme( 'twentytwentyone' );