You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an HTML element comes from a different iframe, its constructor won't equal HTMLElement. It'll equal otherWindow.HTMLElement, and that means the test in overwriteMethod('match') returns false when it ought to let the call to .matches() go through.
I'm not sure there's a sensible way to allow this. Testing .constructor.name will miss subclasses of HTMLElement, but you could just test for whether .matches() is callable.
The text was updated successfully, but these errors were encountered:
Good points. If you're doing iframe testing, what about also injecting another copy of chai and chai-dom into that frame so the .should chain works? yeah it's more work, but so is the story of using iframes in your same domain (something I've always avoided and it never made much sense to me).
If an HTML element comes from a different iframe, its constructor won't equal
HTMLElement
. It'll equalotherWindow.HTMLElement
, and that means the test inoverwriteMethod('match')
returnsfalse
when it ought to let the call to.matches()
go through.I'm not sure there's a sensible way to allow this. Testing
.constructor.name
will miss subclasses ofHTMLElement
, but you could just test for whether.matches()
is callable.The text was updated successfully, but these errors were encountered: