Skip to content

Commit

Permalink
Change Detection: Change testing approach for consecutive edits to av…
Browse files Browse the repository at this point in the history
…oid the fickle `assertIsDirty`.
  • Loading branch information
epiqueras committed Nov 21, 2019
1 parent 0219122 commit 200924c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/e2e-tests/specs/editor/various/change-detection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,34 +362,32 @@ describe( 'Change detection', () => {
await clickBlockAppender();
await page.keyboard.type( 'Hello, World!' );

// Save
// Save and wait till the post is clean.
await Promise.all( [
page.waitForSelector( '.editor-post-saved-state.is-saved' ),
pressKeyWithModifier( 'primary', 'S' ),
] );

await assertIsDirty( false );

// Increase the paragraph's font size.
await page.click( '[data-type="core/paragraph"]' );
await page.select( '.components-select-control__input', 'large' );
await page.click( '[data-type="core/paragraph"]' );

await assertIsDirty( true );
// Check that the post is dirty.
await page.waitForSelector( '.editor-post-save-draft' );

// Save
// Save and wait till the post is clean.
await Promise.all( [
page.waitForSelector( '.editor-post-saved-state.is-saved' ),
pressKeyWithModifier( 'primary', 'S' ),
] );

await assertIsDirty( false );

// Increase the paragraph's font size again.
await page.click( '[data-type="core/paragraph"]' );
await page.select( '.components-select-control__input', 'huge' );
await page.click( '[data-type="core/paragraph"]' );

await assertIsDirty( true );
// Check that the post is dirty.
await page.waitForSelector( '.editor-post-save-draft' );
} );
} );

0 comments on commit 200924c

Please sign in to comment.