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

Patterns: Reinstate template parts mode spec #52780

Merged
merged 2 commits into from
Jul 20, 2023
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
37 changes: 37 additions & 0 deletions test/e2e/specs/site-editor/hybrid-theme.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,41 @@ test.describe( 'Hybrid theme', () => {
page.locator( 'role=menuitem[name="Create template part"i]' )
).toBeHidden();
} );

test( 'can access template parts list page', async ( { admin, page } ) => {
await admin.visitAdminPage(
'site-editor.php',
'postType=wp_template_part&path=/wp_template_part/all'
);

await expect(
page.getByRole( 'table' ).getByRole( 'link', { name: 'header' } )
).toBeVisible();
} );

test( 'can view a template part', async ( { admin, editor, page } ) => {
await admin.visitAdminPage(
'site-editor.php',
'postType=wp_template_part&path=/wp_template_part/all'
);

const templatePart = page
.getByRole( 'table' )
.getByRole( 'link', { name: 'header' } );

await expect( templatePart ).toBeVisible();
await templatePart.click();

await expect(
page.getByRole( 'region', { name: 'Editor content' } )
).toBeVisible();

await editor.canvas.click( 'body' );

await expect(
editor.canvas.getByRole( 'document', {
name: 'Block: Site Title',
} )
).toBeVisible();
} );
} );
Loading