Skip to content

FindAll vs Find #395

Answered by egil
dady8889 asked this question in Q&A
May 11, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi again,

Yeah, this is a little non-obvious admittedly. What happens is that when you call Change, the components render, and a new DOM tree is build, replacing the old one (DOM tree has the IElements in it).

Find actually returns an adapter/wrapper around the IElement, and this adapter automatically retrieves the new element from the new DOM tree after the call from Change. FindAll does the same, if you do not pass false as the second parameter. However, when you pull IElements out of the inputs list, then FindAll cannot update those any more, at least not in the current implementation.

So what you are asserting against on line Assert.AreEqual(a.GetAttribute("value"), "aaaaaaaaaaaaaaaaa");

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by egil
Comment options

You must be logged in to vote
1 reply
@egil
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants