DEV: A manual test waiter might not be needed (#16142)

This commit is contained in:
Jarek Radosz 2022-03-09 15:38:10 +01:00 committed by GitHub
parent fbef828ab2
commit 2ba602708a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 12 deletions

View File

@ -3,7 +3,6 @@ import {
linkSeenMentions,
} from "discourse/lib/link-mentions";
import { module, test } from "qunit";
import { Promise } from "rsvp";
import pretender from "discourse/tests/helpers/create-pretender";
import domFromString from "discourse-common/lib/dom-from-string";
@ -43,17 +42,6 @@ module("Unit | Utility | link-mentions", function () {
`)[0];
await linkSeenMentions(root);
// Ember.Test.registerWaiter is not available here, so we are implementing
// our own
await new Promise((resolve) => {
const interval = setInterval(() => {
if (root.querySelectorAll("a").length > 0) {
clearInterval(interval);
resolve();
}
}, 500);
});
assert.strictEqual(root.querySelector("a").innerText, "@valid_user");
assert.strictEqual(root.querySelectorAll("a")[1].innerText, "@valid_group");
assert.strictEqual(