Adding extent filter tests
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
goog.provide('ol.test.filter.Extent');
|
||||||
|
|
||||||
|
|
||||||
|
describe('ol.filter.Extent', function() {
|
||||||
|
|
||||||
|
var extent, filter;
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
extent = new ol.Extent(0, 0, 45, 90);
|
||||||
|
filter = new ol.filter.Extent(extent);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('#getExtent()', function() {
|
||||||
|
|
||||||
|
it('returns the configured extent', function() {
|
||||||
|
expect(filter.getExtent()).toBe(extent);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('#evaluate()', function() {
|
||||||
|
|
||||||
|
it('returns true if a feature intersects, false if not', function() {
|
||||||
|
expect(filter.evaluate(new ol.Feature(new ol.geom.Point([44, 89]))))
|
||||||
|
.toBe(true);
|
||||||
|
expect(filter.evaluate(new ol.Feature(new ol.geom.Point([46, 91]))))
|
||||||
|
.toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
goog.require('ol.Extent');
|
||||||
|
goog.require('ol.Feature');
|
||||||
|
goog.require('ol.filter.Extent');
|
||||||
|
goog.require('ol.geom.Point');
|
||||||
Reference in New Issue
Block a user