Don't mutate entity in place

This commit is contained in:
John Firebaugh
2012-12-04 13:30:29 -05:00
parent 103678b36d
commit 60e7698f1a
2 changed files with 11 additions and 3 deletions
+9
View File
@@ -54,6 +54,15 @@ describe('Graph', function() {
});
});
describe("#fetch", function () {
it("replaces node ids with references", function () {
var node = iD.Node({id: "n1"}),
way = iD.Way({id: "w1", nodes: ["n1"]}),
graph = iD.Graph({n1: node, w1: way});
expect(graph.fetch("w1").nodes).to.eql([node]);
});
});
describe("#modifications", function () {
it("filters entities by modified", function () {
var a = {id: 'a', modified: function () { return true; }},