Skip to content

Commit

Permalink
Editor: Add e2e test.
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Nov 4, 2019
1 parent 22475bb commit 4d58c79
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/e2e-tests/specs/editor/various/change-detection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
pressKeyWithModifier,
ensureSidebarOpened,
publishPost,
openDocumentSettingsSidebar,
} from '@wordpress/e2e-test-utils';

describe( 'Change detection', () => {
Expand Down Expand Up @@ -348,4 +349,25 @@ describe( 'Change detection', () => {
// Verify that the post is not dirty.
await assertIsDirty( false );
} );

it( 'should not prompt to confirm unsaved changes when trashing an existing post', async () => {
// Enter title.
await page.type( '.editor-post-title__input', 'Hello World' );

// Save
await Promise.all( [
// Wait for "Saved" to confirm save complete.
page.waitForSelector( '.editor-post-saved-state.is-saved' ),

// Keyboard shortcut Ctrl+S save.
pressKeyWithModifier( 'primary', 'S' ),
] );

// Trash post.
await openDocumentSettingsSidebar();
await page.click( '.editor-post-trash.components-button' );

// Check that the dialog didn't show.
await assertIsDirty( false );
} );
} );

0 comments on commit 4d58c79

Please sign in to comment.