Move node removal into removeNodeWay action

This commit is contained in:
John Firebaugh
2012-12-04 18:07:26 -05:00
parent f49270fc6c
commit 76849596f8
5 changed files with 12 additions and 4 deletions
+1
View File
@@ -64,6 +64,7 @@
<!-- include spec files here... -->
<script src="spec/actions/add_way_node.js"></script>
<script src="spec/actions/remove_way_node.js"></script>
<script src="spec/format/geojson.js"></script>
<script src="spec/format/xml.js"></script>
<script src="spec/graph/graph.js"></script>
+1
View File
@@ -26,6 +26,7 @@
<!-- include spec files here... -->
<script src="spec/actions/add_way_node.js"></script>
<script src="spec/actions/remove_way_node.js"></script>
<script src="spec/format/geojson.js"></script>
<script src="spec/format/xml.js"></script>
<script src="spec/graph/graph.js"></script>
+8
View File
@@ -0,0 +1,8 @@
describe("iD.actions.removeWayNode", function () {
it("removes a node from a way", function () {
var node = iD.Node({id: "n1"}),
way = iD.Way({id: "w1", nodes: ["n1"]}),
graph = iD.actions.removeWayNode(way, node)(iD.Graph({n1: node, w1: way}));
expect(graph.entity(way.id).nodes).to.eql([]);
});
});