I am aware that binding to jquery events in angular “controller” is not in line with this framework philosophy but it allows me to migrate views in asp.net mvc project to angular step by step. This works on runtime but i can’t test this. If I have binded jquery event ‘keydown’ on input field in “controller” and I try to trigger() this event in my test scenario (I am using angular-scenario.js) this event simply is not recieved in “controller”. I cant use input().enter() as this input is not part of model (as I said on beginning…). Question: is it possible to trigger event from scenario? If not, should I use different test runner?
Share
You can take a look into AngularJS tests. They use
browserTrigger(element, 'keydown');to trigger DOM events on elements.Here is example from AngularJS source