How can I trigger a select interaction on openlayer map in angular unit testing? below is my select event code.
let select = new Select({style: null});
select.set('selectInteraction', 'name');
select.on('select', (e) => {
console.log('selected');
});
this.map.addInteraction(select);
in the unit test I am trying to validate the select event as below but couldn't achieve it.
it('should verify select event trigger', () => {
const mapEvent = new MapBrowserEvent('select', component.map, new UIEvent('select'));
var evt = new SelectEvent('select', [], [], mapEvent);
// Getting the select interaction to try for some action.
const selectInteraction = component.map.getInteractions().getArray().filter(action => action.get('mySelectInteraction'));
component.map.dispatchEvent(evt);
// here will do my expectation validation.
});
Need some help to perform this action.