DEV: Work around HTMLElement.innerText differences between browsers (#14297)

This commit is contained in:
Rafael dos Santos Silva 2021-09-09 14:01:22 -03:00 committed by GitHub
parent 009d18e497
commit 3469f7b74f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 9 deletions

View File

@ -707,9 +707,12 @@ acceptance(
test("suggested messages for group messages without new or unread", async function (assert) {
await visit("/t/13");
assert.equal(
query(".suggested-topics-message").innerText.trim(),
"Want to read more? Browse other messages in awesome_group.",
assert.ok(
query(".suggested-topics-message")
.innerText.trim()
.match(
/Want to read more\? Browse other messages in\s+awesome_group\./
),
"displays the right browse more message"
);
});
@ -721,9 +724,12 @@ acceptance(
await visit("/t/13"); // await re-render
assert.equal(
query(".suggested-topics-message").innerText.trim(),
"There is 1 new message remaining, or browse other messages in awesome_group",
assert.ok(
query(".suggested-topics-message")
.innerText.trim()
.match(
/There is 1 new message remaining, or browse other messages in\s+awesome_group/
),
"displays the right browse more message"
);
@ -731,9 +737,12 @@ acceptance(
await visit("/t/13"); // await re-render
assert.equal(
query(".suggested-topics-message").innerText.trim(),
"There is 1 unread and 1 new message remaining, or browse other messages in awesome_group",
assert.ok(
query(".suggested-topics-message")
.innerText.trim()
.match(
/There is 1 unread and 1 new message remaining, or browse other messages in\s+awesome_group/
),
"displays the right browse more message"
);
});