Skip to content

Commit

Permalink
Merge tests into new hybrid-theme spec
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jul 20, 2023
1 parent 599a548 commit a8c3007
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 51 deletions.
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();
} );
} );
51 changes: 0 additions & 51 deletions test/e2e/specs/site-editor/template-parts-mode.spec.js

This file was deleted.

0 comments on commit a8c3007

Please sign in to comment.