Fixing draw mode bugs

Disabling interactive draw undo for now. I know how to fix it
but it's a bit tricky. So undo will just drop you out to browse
mode for the time being.

Fixes #477.
Fixes #516.
This commit is contained in:
John Firebaugh
2013-01-26 15:24:06 -05:00
parent ec971ceac7
commit e09666bbdc
7 changed files with 108 additions and 90 deletions
+28
View File
@@ -70,6 +70,27 @@ describe("iD.History", function () {
});
});
describe("#pop", function () {
it("updates the graph", function () {
history.perform(action, "annotation");
history.pop();
expect(history.undoAnnotation()).to.be.undefined;
});
it("does not push the redo stack", function () {
history.perform(action, "annotation");
history.pop();
expect(history.redoAnnotation()).to.be.undefined;
});
it("emits a change event", function () {
history.perform(action);
history.on('change', spy);
history.pop();
expect(spy).to.have.been.calledWith([]);
});
});
describe("#undo", function () {
it("pops the undo stack", function () {
history.perform(action, "annotation");
@@ -77,6 +98,13 @@ describe("iD.History", function () {
expect(history.undoAnnotation()).to.be.undefined;
});
it("pops past unannotated states", function () {
history.perform(action, "annotation");
history.perform(action);
history.undo();
expect(history.undoAnnotation()).to.be.undefined;
});
it("pushes the redo stack", function () {
history.perform(action, "annotation");
history.undo();