jquery-simulate icon indicating copy to clipboard operation
jquery-simulate copied to clipboard

Null relatedTarget in HtmlUnit

Open lukepalmer opened this issue 12 years ago • 0 comments

Very useful project!

I find that when running tests with jasmine-maven-plugin, specifically when running a headless test (which internally uses HtmlUnit for the "browser") that event.relatedTarget can be null. This throws on line 118 which tries to get event.relatedTarget.ownerDocument. The same thing works fine when testing inside a browser.

My fix is: eventDoc = event.relatedTarget ? event.relatedTarget.ownerDocument : undefined || document;

lukepalmer avatar Aug 07 '13 16:08 lukepalmer