Don't write unsavable changes to localStorage (closes #2705)

This commit is contained in:
Bryan Housel
2015-06-20 12:21:29 -04:00
parent 60fdb60a8a
commit 728036be51
2 changed files with 8 additions and 1 deletions

View File

@@ -272,6 +272,13 @@ describe("iD.History", function () {
});
describe("#toJSON", function() {
it("doesn't generate unsaveable changes", function() {
var node_1 = iD.Node({id: 'n-1'});
history.perform(iD.actions.AddEntity(node_1));
history.perform(iD.actions.DeleteNode('n-1'));
expect(history.toJSON()).to.be.not.ok;
});
it("generates v3 JSON", function() {
var node_1 = iD.Node({id: 'n-1'}),
node1 = iD.Node({id: 'n1'}),