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

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

diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js
index b63927f..5157fa7 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/user-private-messages-test.js
@@ -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"
       );
     });

GitHub sha: 3469f7b74fb7e3427c88f126019ff1623f41dff9

This commit appears in #14297 which was approved by romanrizzi and markvanlan. It was merged by Falco.