Don't redo into un-annotated edit states

(closes #4006)
This commit is contained in:
Bryan Housel
2017-05-03 00:21:37 -04:00
parent b7c0176498
commit 2ebfcd174e
2 changed files with 22 additions and 9 deletions
+12 -3
View File
@@ -214,14 +214,23 @@ describe('iD.History', function () {
expect(history.redo().changes()).to.eql({});
});
it('emits an redone event', function () {
history.perform(action);
it('does redo into an annotated state', function () {
history.perform(action, 'annotation');
history.on('redone', spy);
history.undo();
history.on('change', spy);
history.redo();
expect(history.undoAnnotation()).to.equal('annotation');
expect(spy).to.have.been.called;
});
it('does not redo into a non-annotated state', function () {
history.perform(action);
history.on('redone', spy);
history.undo();
history.redo();
expect(spy).not.to.have.been.called;
});
it('emits a change event', function () {
history.perform(action);
history.undo();