iD.actions.Revert (see #537)

This commit is contained in:
Bryan Housel
2015-04-26 01:08:31 -04:00
parent 6b18066dd6
commit c10b83f28f
5 changed files with 20 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
describe('iD.actions.Revert', function() {
it('reverts an entity', function() {
var n1 = iD.Node({id: 'n' }),
n2 = n1.update({}),
graph = iD.Graph([n1]).replace(n2);
expect(graph.entity('n')).to.equal(n2);
graph = iD.actions.Revert(n2)(graph)
expect(graph.entity('n')).to.equal(n1);
});
});