Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Triggering event listeners bound to document with custom events in tests #12518
I'm submitting a ... (check one with "x")
Currently triggering custom event listeners bound to
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
My use case is because I have a complex module for dragging & dropping built purely in Angular 2 that my company intends on open sourcing, so I need to test DOM positioning & logic involving the mouse cursor. I am trying to hook into a directive's listener bound to
I can currently hack around this by querying the directive, creating a fake mouse event object, and using the injector for the element to get the directive instance & firing the method directly, but this is awkward. This is necessary for me currently because our CI setup uses PhantomJS, and we don't have anything like headless Chrome yet, so creating a custom MouseEvent using
Please tell us about your environment: macOS Sierra
changed the title from
Triggering event listeners bound to document with custom events
Triggering event listeners bound to document with custom events in tests
Oct 25, 2016
Just to show a workaround solution to help others...