UndoManager test: checkpoint
This commit is contained in:
parent
6b29902810
commit
ea1835ca53
1 changed files with 3 additions and 0 deletions
|
@ -7,6 +7,7 @@ import {Utils} from './utils'
|
|||
test('Basic undo/redo', async () => {
|
||||
expect(undoManager.canUndo).toBe(false)
|
||||
expect(undoManager.canRedo).toBe(false)
|
||||
expect(undoManager.currentCheckpoint).toBe(0)
|
||||
|
||||
const values: string[] = []
|
||||
|
||||
|
@ -22,6 +23,7 @@ test('Basic undo/redo', async () => {
|
|||
|
||||
expect(undoManager.canUndo).toBe(true)
|
||||
expect(undoManager.canRedo).toBe(false)
|
||||
expect(undoManager.currentCheckpoint).toBeGreaterThan(0)
|
||||
expect(Utils.arraysEqual(values, ['a'])).toBe(true)
|
||||
expect(undoManager.undoDescription).toBe('test')
|
||||
expect(undoManager.redoDescription).toBe(undefined)
|
||||
|
@ -41,6 +43,7 @@ test('Basic undo/redo', async () => {
|
|||
await undoManager.clear()
|
||||
expect(undoManager.canUndo).toBe(false)
|
||||
expect(undoManager.canRedo).toBe(false)
|
||||
expect(undoManager.currentCheckpoint).toBe(0)
|
||||
expect(undoManager.undoDescription).toBe(undefined)
|
||||
expect(undoManager.redoDescription).toBe(undefined)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue