What is the difference between dispatchEvent() and triggerEventHandler() in angular unit testing using karma?

后端 未结 2 1109
耶瑟儿~
耶瑟儿~ 2021-01-13 00:13

I am writing unit test for a directive(called on input event), which is modifying an input value on a formControl. I\'ve created a test component in my spec file for the sam

2条回答
  •  野的像风
    2021-01-13 00:58

    I noticed same issue as well. What I found is triggerEventHandler() works in the button testing scenario but not the input case while dispatchevent works in the input scenario which is your case.

提交回复
热议问题