This is a global (window) function that is only available when the ngMock
module is
included.
It can be used to trigger a native browser event on an element, which is useful for unit testing.
browserTrigger(element, [eventType], [eventData]);
Param | Type | Details |
---|---|---|
element | Object |
Either a wrapped jQuery/jqLite node or a DOMElement |
eventType
(optional)
|
string |
Optional event type. If none is specified, the function tries
to determine the right event type for the element, e.g. |
eventData
(optional)
|
Object |
An optional object which contains additional event data that is used when creating the event:
|