scalatags-rx icon indicating copy to clipboard operation
scalatags-rx copied to clipboard

consider using outerHTML in tests

Open pawelpanasewicz opened this issue 8 years ago • 0 comments

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" ...

pawelpanasewicz avatar Sep 29 '16 11:09 pawelpanasewicz