Skip to content

Commit

Permalink
Change "Swap" to "Replace" for Template Action (WordPress#68234)
Browse files Browse the repository at this point in the history
Unlinked contributors: bgardner, kohheepeace.

Co-authored-by: karthick-murugan <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
5 people authored Jan 14, 2025
1 parent b949616 commit f73a06f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function SwapTemplateButton( { onClick } ) {
return (
<>
<MenuItem onClick={ () => setShowModal( true ) }>
{ __( 'Swap template' ) }
{ __( 'Change template' ) }
</MenuItem>
{ showModal && (
<Modal
Expand Down
2 changes: 1 addition & 1 deletion packages/fields/src/fields/template/template-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const TemplateEdit = ( {
onToggle();
} }
>
{ __( 'Swap template' ) }
{ __( 'Change template' ) }
</MenuItem>
{
// The default template in a post is indicated by an empty string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test.describe( 'Post Editor Template mode', () => {
).toBeVisible();
} );

test( 'Swap templates and proper template resolution when switching to default template', async ( {
test( 'Change templates and proper template resolution when switching to default template', async ( {
editor,
page,
requestUtils,
Expand All @@ -88,10 +88,10 @@ test.describe( 'Post Editor Template mode', () => {
await page.reload();
await postEditorTemplateMode.disableTemplateWelcomeGuide();
await postEditorTemplateMode.openTemplatePopover();
// Swap to a custom template, save and reload.
// Change to a custom template, save and reload.
await page
.getByRole( 'menuitem', {
name: 'Swap template',
name: 'Change template',
} )
.click();
await page
Expand All @@ -101,7 +101,7 @@ test.describe( 'Post Editor Template mode', () => {
.click();
await editor.saveDraft();
await page.reload();
// Swap to the default template.
// Change to the default template.
await postEditorTemplateMode.openTemplatePopover();
await page
.getByRole( 'menuitem', {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/specs/site-editor/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ test.describe( 'Pages', () => {
await templateOptionsButton.click();
await page
.getByRole( 'menu', { name: 'Template options' } )
.getByText( 'Swap template' )
.getByText( 'Change template' )
.click();
const templateItem = page.locator(
'.block-editor-block-patterns-list__item-title'
Expand All @@ -305,7 +305,7 @@ test.describe( 'Pages', () => {
await expect( templateOptionsButton ).toHaveText( 'Single Entries' );
} );

test( 'swap template options should respect the declared `postTypes`', async ( {
test( 'change template options should respect the declared `postTypes`', async ( {
page,
editor,
} ) => {
Expand All @@ -321,7 +321,7 @@ test.describe( 'Pages', () => {
await expect(
page
.getByRole( 'menu', { name: 'Template options' } )
.getByText( 'Swap template' )
.getByText( 'Change template' )
).toHaveCount( 0 );
} );
} );
10 changes: 5 additions & 5 deletions test/e2e/specs/site-editor/template-registration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test.describe( 'Block template registration', () => {
).toBeHidden();
} );

test( 'registered templates are available in the Swap template screen', async ( {
test( 'registered templates are available in the Change template screen', async ( {
admin,
editor,
page,
Expand All @@ -106,10 +106,10 @@ test.describe( 'Block template registration', () => {
attributes: { content: 'User-created post.' },
} );

// Swap template.
// Change template.
await page.getByRole( 'button', { name: 'Post', exact: true } ).click();
await page.getByRole( 'button', { name: 'Template options' } ).click();
await page.getByRole( 'menuitem', { name: 'Swap template' } ).click();
await page.getByRole( 'menuitem', { name: 'Change template' } ).click();
await page.getByText( 'Plugin Template' ).click();

// Verify the template is applied.
Expand All @@ -133,10 +133,10 @@ test.describe( 'Block template registration', () => {
attributes: { content: 'User-created post.' },
} );

// Swap template.
// Change template.
await page.getByRole( 'button', { name: 'Post', exact: true } ).click();
await page.getByRole( 'button', { name: 'Template options' } ).click();
await page.getByRole( 'menuitem', { name: 'Swap template' } ).click();
await page.getByRole( 'menuitem', { name: 'Change template' } ).click();
await page.getByText( 'Custom', { exact: true } ).click();

// Verify the theme template is applied.
Expand Down

0 comments on commit f73a06f

Please sign in to comment.