Enable remaining ol.source.Vector tests

This commit is contained in:
Tom Payne
2013-12-04 15:03:20 +01:00
parent 79c6787e52
commit aa0a02b935

View File

@@ -137,7 +137,7 @@ describe('ol.source.Vector', function() {
});
describe.skip('#removeFeature', function() {
describe('#removeFeature', function() {
it('works as expected', function() {
var i;
@@ -159,46 +159,29 @@ describe('ol.source.Vector', function() {
describe('modifying a feature\'s geometry', function() {
it('fires a change event', function() {
var listener = sinon.spy();
goog.events.listen(vectorSource, 'change', listener);
it('keeps the R-Tree index up to date', function() {
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
features[0].getGeometry().setCoordinates([100, 100]);
expect(listener).to.be.called();
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(9);
features[0].getGeometry().setCoordinates([0.5, 0.5]);
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
});
if (false) {
it('keeps the R-Tree index up to date', function() {
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
features[0].getGeometry().setCoordinates([100, 100]);
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(9);
features[0].getGeometry().setCoordinates([0.5, 0.5]);
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
});
}
});
describe('setting a features geometry', function() {
it('fires a change event', function() {
var listener = sinon.spy();
goog.events.listen(vectorSource, 'change', listener);
it('keeps the R-Tree index up to date', function() {
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
features[0].setGeometry(new ol.geom.Point([100, 100]));
expect(listener).to.be.called();
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(9);
});
if (false) {
it('keeps the R-Tree index up to date', function() {
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(10);
features[0].setGeometry(new ol.geom.Point([100, 100]));
expect(vectorSource.getAllFeaturesInExtent([0, 0, 1, 1])).
to.have.length(9);
});
}
});
});