Open
Description
we often write assertions in ember-land like this:
const i18n = this.owner.lookup('service:i18n')
assert.dom('[data-test-foo']
.hasText(i18n.t('Some.Key'))
This test fails because i18n.t('Some.Key')
is not a string and a TypeError is thrown: https://github.com/simplabs/qunit-dom/blob/e2b3b4f4f82da36733ce659815e092e73ee1c598/lib/assertions.ts#L919-L921
We work around this by changing the assertion to
assert.dom('[data-test-foo']
- .hasText(i18n.t('Some.Key'))
+ .hasText(String(i18n.t('Some.Key')))
I'm not sure what the right answer, but wanted to report anyway. In our case, we're using ember-i18n, so the return type happens to be a SafeString
from Ember's htmlSafe()
util.
Metadata
Metadata
Assignees
Labels
No labels