Files
iD/test/spec/actions/delete_multiple.js
John Firebaugh c50c3121d8 Make Graph#entity strict
Use Graph#hasEntity for the previous behavior.
2013-04-24 09:27:37 -07:00

22 lines
884 B
JavaScript

describe("iD.actions.DeleteMultiple", function () {
it("deletes multiple entities of heterogeneous types", function () {
var n = iD.Node(),
w = iD.Way(),
r = iD.Relation(),
action = iD.actions.DeleteMultiple([n.id, w.id, r.id]),
graph = action(iD.Graph([n, w, r]));
expect(graph.hasEntity(n.id)).to.be.undefined;
expect(graph.hasEntity(w.id)).to.be.undefined;
expect(graph.hasEntity(r.id)).to.be.undefined;
});
it("deletes a way and one of its nodes", function () {
var n = iD.Node(),
w = iD.Way({nodes: [n.id]}),
action = iD.actions.DeleteMultiple([w.id, n.id]),
graph = action(iD.Graph([n, w]));
expect(graph.hasEntity(w.id)).to.be.undefined;
expect(graph.hasEntity(n.id)).to.be.undefined;
});
});