Closed dwilhelmi closed 4 years ago
hmm, interesting, I was pretty sure I implemented it that way at first. Has this possibly changed lately?
Not sure - findElement
currently supports Element targets, but findElements
does not. As promised, I have pushed up a PR with a possible fix - https://github.com/simplabs/qunit-dom/pull/246
thinking some more about it, why do you use assert.dom(element).exists()
instead of just assert.ok(element)
? wouldn't the latter be easier?
Even though officially the
dom
method accepts theElement
type
it does, but not all assertions support it. just like with e.g. chai when you expect(5)
you can't use something like .to.contain(4)
.
I just came up against this issue using assert.dom(element).isNotVisible()
, findElements
doesn't allow using an HTMLElement
Bumping this... We see the error with assert.dom(element).isVisible()
@dwilhelmi will you have time to wrap up the PR? If not, would you care if I take it over?
I also encountered this with isNotVisible()
. Could the proposed PR be merged or is there any other work left to be done on it?
Just to clarify, are folks encountering this issue using Typescript in their projects, and they're getting a type mismatch?
I’m getting this in an Ember project, not using Typescript.
@scalvert it's been a while since I've commented but we don't use TypeScript
Let me take a peek again and see if there's anything outstanding we need on that PR.
Sorry that everyone's been encountering this issue. I'm working on it now, and just adding a number of test cases to ensure that our fix is working.
Ready to go! Just waiting for a merge/release. Thanks for your patience, everyone!
Even though officially the
dom
method accepts theElement
type, when using it that way theexists
method ends up throwing an error, even if the element exists. At root, this is becauseexists
callsfindElements
, which is not currently set up to check forthis.target
being anything other than a string.I have a PR inbound shortly to add support to
findElements
for having Element targets, but wanted to track it here also.