Add tests for intersectsExtent/getExtent
This commit adds tests for `intersectsExtent` of Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. It also adds a basic test for `getExtent` of MultiPolygon
This commit is contained in:
@@ -37,6 +37,14 @@ describe('ol.geom.Point', function() {
|
||||
expect(point.getStride()).to.be(2);
|
||||
});
|
||||
|
||||
it('does not intersect non matching extent', function() {
|
||||
expect(point.intersectsExtent([0, 0, 10, 0.5])).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect it\'s extent', function() {
|
||||
expect(point.intersectsExtent(point.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('construct with 3D coordinates and layout XYM', function() {
|
||||
@@ -66,6 +74,14 @@ describe('ol.geom.Point', function() {
|
||||
expect(point.getStride()).to.be(3);
|
||||
});
|
||||
|
||||
it('does not intersect non matching extent', function() {
|
||||
expect(point.intersectsExtent([0, 0, 10, 0.5])).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect it\'s extent', function() {
|
||||
expect(point.intersectsExtent(point.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('construct with 4D coordinates', function() {
|
||||
@@ -95,6 +111,14 @@ describe('ol.geom.Point', function() {
|
||||
expect(point.getStride()).to.be(4);
|
||||
});
|
||||
|
||||
it('does not intersect non matching extent', function() {
|
||||
expect(point.intersectsExtent([0, 0, 10, 0.5])).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect it\'s extent', function() {
|
||||
expect(point.intersectsExtent(point.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
describe('#getClosestPoint', function() {
|
||||
|
||||
it('preseves extra dimensions', function() {
|
||||
|
||||
Reference in New Issue
Block a user