mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
18 lines
741 B
JavaScript
18 lines
741 B
JavaScript
describe("iD.actions.DeleteRelation", function () {
|
|
it("removes the relation from the graph", function () {
|
|
var relation = iD.Relation(),
|
|
action = iD.actions.DeleteRelation(relation.id),
|
|
graph = action(iD.Graph([relation]));
|
|
expect(graph.entity(relation.id)).to.be.undefined;
|
|
});
|
|
|
|
it("removes the relation from parent relations", function () {
|
|
var a = iD.Relation(),
|
|
b = iD.Relation(),
|
|
parent = iD.Relation({members: [{ id: a.id }, { id: b.id }]}),
|
|
action = iD.actions.DeleteRelation(a.id),
|
|
graph = action(iD.Graph([a, b, parent]));
|
|
expect(graph.entity(parent.id).members).to.eql([{ id: b.id }]);
|
|
});
|
|
});
|