Skip to content

Commit

Permalink
add undo test
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed May 9, 2014
1 parent a70a95e commit db625bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/modules/undo-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ describe('UndoManager', ->
, @undoManager.options.delay * 1.25)
)

it('multiple undos', (done) ->
expect(@undoManager.stack.undo.length).toEqual(0)
@quill.updateContents(Tandem.Delta.makeInsertDelta(13, 12, 'e'))
contents = @quill.getContents()
setTimeout( =>
@quill.updateContents(Tandem.Delta.makeInsertDelta(14, 13, 's'))
@undoManager.undo()
expect(@quill.getContents()).toEqual(contents)
@undoManager.undo()
expect(@quill.getContents()).toEqual(@original)
done()
, @undoManager.options.delay * 1.25)
)

it('hotkeys', ->
@quill.updateContents(Tandem.Delta.makeInsertDelta(13, 0, 'A '))
changed = @quill.getContents()
Expand Down

0 comments on commit db625bc

Please sign in to comment.