enzymejs/enzyme

hobgoblin: .html() output for <hr/> differs for shallow() vs. render()

Open

#294 aberto em 4 de abr. de 2016

Ver no GitHub
 (8 comments) (0 reactions) (0 assignees)JavaScript (2.016 forks)batch import
help wanted

Métricas do repositório

Stars
 (19.979 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Testing a minor component that renders only <div><hr /></div>. I was attempting to evaluate testing with outputs from shallow() vs. render() when I found differences in the results from .html().

The shallow renderer's shallowWrapper.html() returns <div><hr/></div>

The static renderer's renderWrapper.html() returns <div><hr></div>

Is static rendering with cheerio causing the strange "how do we represent self-closing elements" differences?

Is there a mention in the docs that nothing is guaranteed about outputs from .html() and .text()?

Is there a stated/doced bias for which renderer to prefer?

Should I tell my consistency hobgoblin to go join the troll under the nearest bridge?

Guia do colaborador