scalatags-rx
scalatags-rx copied to clipboard
consider using outerHTML in tests
In tests assertions are made using node.innerText
.
Stronger assertions would be when comparing results on outerHTML
level.
Consider below example:
val c = Var("")
val d = Var("")
val node = span(c, d).render
assert(node.textContent == "") //this assertion is weaker than the below one
assert(node.outerHTML == "<span></span>")
Asserting assert(node.outerHTML == "<span></span>"
will tell much more about what happened.
Are there any particular reasons for not using it? Sorry, I don't have much experience with "DOM API" ...