Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 13, 2024
1 parent 9b68638 commit 949f6a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 6 additions & 8 deletions test/e2e/specs/editor/various/change-detection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,19 +411,17 @@ test.describe( 'Change detection', () => {
await editor.openDocumentSettingsSidebar();
await page
.getByRole( 'region', { name: 'Editor settings' } )
.getByRole( 'button', { name: 'Move to trash' } )
.getByRole( 'button', { name: 'Actions' } )
.click();
await page
.getByRole( 'menu' )
.getByRole( 'menuitem', { name: 'Move to Trash' } )
.click();
await page
.getByRole( 'dialog' )
.getByRole( 'button', { name: 'Move to trash' } )
.getByRole( 'button', { name: 'Delete' } )
.click();

await expect(
page
.getByRole( 'region', { name: 'Editor top bar' } )
.getByRole( 'button', { name: 'saved' } )
).toBeDisabled();

await expect( page ).toHaveURL( '/wp-admin/edit.php?post_type=post' );
} );

Expand Down
7 changes: 5 additions & 2 deletions test/e2e/specs/site-editor/template-revert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ test.describe( 'Template Revert', () => {
page.locator(
'role=region[name="Editor settings"i] >> role=button[name="Actions"i]'
)
).toBeHidden();
).toBeDisabled();
} );

test( 'should show the original content after revert', async ( {
Expand Down Expand Up @@ -179,6 +179,10 @@ test.describe( 'Template Revert', () => {
await editor.saveSiteEditorEntities( {
isOnlyCurrentEntityDirty: true,
} );
await page
.getByRole( 'button', { name: 'Dismiss this notice' } )
.getByText( /(updated|published)\./ )
.click();
const contentBefore =
await templateRevertUtils.getCurrentSiteEditorContent();

Expand All @@ -190,7 +194,6 @@ test.describe( 'Template Revert', () => {
await editor.saveSiteEditorEntities( {
isOnlyCurrentEntityDirty: true,
} );

await admin.visitSiteEditor();

const contentAfter =
Expand Down

0 comments on commit 949f6a1

Please sign in to comment.