Fix typo, add test

This commit is contained in:
Andreas Hocevar
2021-04-01 08:38:29 +02:00
parent a01893b275
commit 59d686d104
2 changed files with 13 additions and 1 deletions

View File

@@ -143,6 +143,18 @@ describe('ol.source.Vector', function () {
expect(feature).to.be(features[0]);
});
});
describe('#getFeatures', function () {
it('does not return the internal array when useSpatialIndex is false', function () {
const noSpatialIndexSource = new VectorSource({
useSpatialIndex: false,
features: vectorSource.getFeatures(),
});
expect(noSpatialIndexSource.getFeatures()).to.not.be(
noSpatialIndexSource.getFeaturesCollection().getArray()
);
});
});
});
describe('clear and refresh', function () {