Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(e2e)(template-parts) Add E2E test for editing the title of a new custom template part #50195

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions test/e2e/specs/editor/various/post-editor-template-mode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
fullofcaffeine marked this conversation as resolved.
Show resolved Hide resolved

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' );
Expand Down