diff --git a/test/spec/util.js b/test/spec/util.js index 07968e7c7..8a23b131a 100644 --- a/test/spec/util.js +++ b/test/spec/util.js @@ -35,6 +35,22 @@ describe('Util', function() { expect(iD.util.geo.interp(a, b, 0)).to.eql({ lat: 0, lon: 0}); }); }); + describe('#nodeIntersect', function() { + it('correctly says that a node is in an extent', function() { + expect(iD.util.geo.nodeIntersect({ + lat: 0, lon: 0 + }, [ + [-180, 90], + [180, -90]])).to.be.true; + }); + it('correctly says that a node is outside of an extent', function() { + expect(iD.util.geo.nodeIntersect({ + lat: 0, lon: 0 + }, [ + [100, 90], + [180, -90]])).to.be.false; + }); + }); describe('#dist', function() { it('distance between two same points is zero', function() { var a = [0, 0],