Protect against relation loops (fixes #2072)

This commit is contained in:
John Firebaugh
2014-01-02 17:42:57 -08:00
parent 4ce9bedb9c
commit 7bbca76a20
2 changed files with 11 additions and 2 deletions

View File

@@ -44,6 +44,12 @@ describe('iD.Relation', function () {
expect(r.extent(graph)).to.eql([[0, 0], [0, 0]])
});
it("does not error on self-referencing relations", function () {
var r = iD.Relation();
r = r.addMember({id: r.id});
expect(r.extent(iD.Graph([r]))).to.eql(iD.geo.Extent())
});
});
describe("#geometry", function () {