How to simulate mouse events in Jasmine tests in Angular 2 or 4
问题 I am pretty new to Jasmine testing and I am trying to test a directive which handles mouse events like mouse down, up and move. My question is how can I pass mouse coordinates from the spec of Jasmine to my directive and simulate the mouse events. I have searched a lot on this topic but I couldn't find any examples except for this one which doesn't do anything like passing the coordinates of the element. The following is my attempt to write the test using the TestBed configuration in Angular: