Additional tests for LineString
This commit is contained in:
@@ -73,6 +73,12 @@ describe('ol.geom.LineString', function() {
|
||||
expect(lineString.getStride()).to.be(2);
|
||||
});
|
||||
|
||||
describe('#intersectsCoordinate', function() {
|
||||
it('returns true for an intersecting coordinate', function() {
|
||||
expect(lineString.intersectsCoordinate([1.5, 2.5])).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#intersectsExtent', function() {
|
||||
|
||||
it('return false for non matching extent', function() {
|
||||
@@ -89,6 +95,23 @@ describe('ol.geom.LineString', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('#intersectsCoordinate', function() {
|
||||
|
||||
it('detects intersecting coordinates', function() {
|
||||
expect(lineString.intersectsCoordinate([1, 2])).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getClosestPoint', function() {
|
||||
|
||||
it('uses existing vertices', function() {
|
||||
const closestPoint = lineString.getClosestPoint([0.9, 1.8]);
|
||||
expect(closestPoint).to.eql([1, 2]);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#getCoordinateAt', function() {
|
||||
|
||||
it('return the first point when fraction is 0', function() {
|
||||
|
||||
Reference in New Issue
Block a user