-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich Text: Remove createUndoLevel for split, merge (#7650)
* History: Update redo button class name Already referenced as such in e2e/specs/hello.test.js * Testing: Add basic E2E tests for undo behavior * Rich Text: Remove createUndoLevel for split, merge
- Loading branch information
Showing
3 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import '../support/bootstrap'; | ||
import { | ||
newPost, | ||
newDesktopBrowserPage, | ||
pressWithModifier, | ||
getHTMLFromCodeEditor, | ||
} from '../support/utils'; | ||
|
||
describe( 'undo', () => { | ||
beforeAll( async () => { | ||
await newDesktopBrowserPage(); | ||
await newPost(); | ||
} ); | ||
|
||
it( 'Should undo to expected level intervals', async () => { | ||
await page.click( '.editor-default-block-appender' ); | ||
|
||
await page.keyboard.type( 'This' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( 'is' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( 'test' ); | ||
|
||
await pressWithModifier( 'mod', 'z' ); // Strip 3rd paragraph text | ||
await pressWithModifier( 'mod', 'z' ); // Strip 3rd paragraph block | ||
await pressWithModifier( 'mod', 'z' ); // Strip 2nd paragraph text | ||
await pressWithModifier( 'mod', 'z' ); // Strip 2nd paragraph block | ||
await pressWithModifier( 'mod', 'z' ); // Strip 1st paragraph text | ||
await pressWithModifier( 'mod', 'z' ); // Strip 1st paragraph block | ||
|
||
expect( await getHTMLFromCodeEditor() ).toBe( '' ); | ||
|
||
// Should have no more history. | ||
const undoButton = await page.$( '.editor-history__undo:not( :disabled )' ); | ||
expect( undoButton ).toBeNull(); | ||
} ); | ||
} ); |