Don't dispatch select event if no feature is selected or deselected
This commit is contained in:
@@ -130,6 +130,21 @@ describe('ol.interaction.Select', function() {
|
||||
expect(features.getLength()).to.equal(1);
|
||||
});
|
||||
|
||||
it('single-click outside the geometry', function() {
|
||||
var listenerSpy = sinon.spy(function(e) {
|
||||
expect(e.selected).to.have.length(1);
|
||||
});
|
||||
select.on('select', listenerSpy);
|
||||
|
||||
simulateEvent(ol.MapBrowserEvent.EventType.SINGLECLICK, -10, -10);
|
||||
|
||||
expect(listenerSpy.callCount).to.be(0);
|
||||
|
||||
var features = select.getFeatures();
|
||||
expect(features.getLength()).to.equal(0);
|
||||
});
|
||||
|
||||
|
||||
it('select with shift single-click', function() {
|
||||
var listenerSpy = sinon.spy(function(e) {
|
||||
expect(e.selected).to.have.length(1);
|
||||
|
||||
Reference in New Issue
Block a user