Regrouping tests
This commit is contained in:
@@ -3,7 +3,22 @@ goog.provide('ol.test.source.Vector');
|
||||
|
||||
describe('ol.source.Vector', function() {
|
||||
|
||||
var vectorSource, features;
|
||||
var vectorSource;
|
||||
|
||||
describe('#addFeatures()', function() {
|
||||
|
||||
it('works', function() {
|
||||
vectorSource = new ol.source.Vector({
|
||||
projection: ol.Projection.getFromCode('EPSG:4326')
|
||||
});
|
||||
vectorSource.addFeatures([new ol.Feature()]);
|
||||
expect(vectorSource.getFeatures().length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getFeatures()', function() {
|
||||
|
||||
var features;
|
||||
|
||||
beforeEach(function() {
|
||||
features = [
|
||||
@@ -22,14 +37,6 @@ describe('ol.source.Vector', function() {
|
||||
vectorSource.addFeatures(features);
|
||||
});
|
||||
|
||||
it('has working addFeatures and getFeatures methods', function() {
|
||||
var featuresInSource = vectorSource.getFeatures();
|
||||
expect(featuresInSource.length).toEqual(features.length);
|
||||
expect(featuresInSource).toContain(features[0]);
|
||||
vectorSource.addFeatures([new ol.Feature()]);
|
||||
expect(vectorSource.getFeatures().length).toEqual(features.length + 1);
|
||||
});
|
||||
|
||||
var geomFilter = new ol.filter.Geometry(ol.geom.GeometryType.LINESTRING);
|
||||
var extentFilter = new ol.filter.Extent(new ol.Extent(16, 48, 16.3, 48.3));
|
||||
|
||||
@@ -64,7 +71,8 @@ describe('ol.source.Vector', function() {
|
||||
expect(subset2.length).toEqual(0);
|
||||
});
|
||||
|
||||
it('can handle any query using the filter\'s evaluate function', function() {
|
||||
it('can handle any query using the filter\'s evaluate function',
|
||||
function() {
|
||||
var filter = new ol.filter.Logical([geomFilter, extentFilter],
|
||||
ol.filter.LogicalOperator.OR);
|
||||
spyOn(filter, 'evaluate').andCallThrough();
|
||||
@@ -75,6 +83,8 @@ describe('ol.source.Vector', function() {
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
goog.require('ol.Projection');
|
||||
goog.require('ol.filter.Geometry');
|
||||
goog.require('ol.filter.Logical');
|
||||
|
||||
Reference in New Issue
Block a user