T
T
tamtakoe2015-08-13 10:44:40
JavaScript
tamtakoe, 2015-08-13 10:44:40

How to test focus/blur events in AngularJS using Jasmine?

There is such a function: https://github.com/tamtakoe/oi.select/blob/master/...
It links the container element (element) and the internal input (inputElement). If focus/blur events happened on the input, it will emit them on the container using element.triggerHandler. If the focus came to the container, then it is transferred to the input using How to test this functionality in Jasmine? Picked here https://github.com/tamtakoe/oi.select/blob/master/... , but so far to no avail. For some reason, the native event call does not work in the test (only ); inputElement[0].focus
spyOn
inputElement[0].focus()inputElement.triggerHandler('focus')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question