You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing whether dynamic content is rendered correctly as HTML, it would be useful to have a hasHtml assertion.
This would be the same as hasText except that instead of testing against textContent, it would test against innerHTML.trim().
The workaround for now is use assert.equal. For instance:
const html = 'Where you put your <b>emphasis</b> is up to you.',
// cause this HTML to be rendered
assert.equal(document.querySelector('.message').innerHTML.trim(), html);
However, having an hasHtml built-in would be more idiomatic:
assert.dom('.message').hasHtml(html);
The text was updated successfully, but these errors were encountered:
When testing whether dynamic content is rendered correctly as HTML, it would be useful to have a
hasHtml
assertion.This would be the same as
hasText
except that instead of testing againsttextContent
, it would test againstinnerHTML.trim()
.The workaround for now is use
assert.equal
. For instance:However, having an
hasHtml
built-in would be more idiomatic:The text was updated successfully, but these errors were encountered: