Add test for new removeFeature behavior

This commit is contained in:
Tim Schaub
2021-10-27 14:11:55 -06:00
parent 855fc6f5bc
commit 1b17f347c0
2 changed files with 17 additions and 7 deletions

View File

@@ -339,6 +339,19 @@ describe('ol.source.Vector', function () {
vectorSource.removeFeature(features[0]);
expect(listener.called).to.be(true);
});
it('accepts features that are not in the source', function () {
const changeListener = sinon.spy();
listen(vectorSource, 'change', changeListener);
const removeFeatureListener = sinon.spy();
listen(vectorSource, 'removefeature', removeFeatureListener);
const feature = new Feature(new Point([0, 0]));
vectorSource.removeFeature(feature);
expect(changeListener.called).to.be(false);
expect(removeFeatureListener.called).to.be(false);
});
});
describe("modifying a feature's geometry", function () {