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
I managed to write an assertion like assert.dom('foo', 'bar') today, where I actually meant assert.dom('foo').hasText('bar') 😱
This is clearly a bug, and actually one that we would be able to catch. The .dom() function does accept an optional second argument, but if it is not undefined then it should be an Element (or at least have querySelector() and querySelectorAll() methods).
I would propose that in the .dom() we check that, if a rootElement is passed to the function, the rootElement has querySelector() and querySelectorAll() methods and otherwise we throw an error, which would have prevented the issue above.
The text was updated successfully, but these errors were encountered:
I managed to write an assertion like
assert.dom('foo', 'bar')
today, where I actually meantassert.dom('foo').hasText('bar')
😱This is clearly a bug, and actually one that we would be able to catch. The
.dom()
function does accept an optional second argument, but if it is notundefined
then it should be anElement
(or at least havequerySelector()
andquerySelectorAll()
methods).I would propose that in the
.dom()
we check that, if arootElement
is passed to the function, therootElement
hasquerySelector()
andquerySelectorAll()
methods and otherwise we throw an error, which would have prevented the issue above.The text was updated successfully, but these errors were encountered: