import { fetchUnseenMentions, linkSeenMentions, } from "discourse/lib/link-mentions"; import { module, test } from "qunit"; import pretender, { response } from "discourse/tests/helpers/create-pretender"; import domFromString from "discourse-common/lib/dom-from-string"; module("Unit | Utility | link-mentions", function () { test("linkSeenMentions replaces users and groups", async function (assert) { pretender.get("/composer/mentions", () => response({ users: ["valid_user"], user_reasons: {}, groups: { valid_group: { user_count: 1 }, mentionable_group: { user_count: 1 }, }, group_reasons: { valid_group: "not_mentionable" }, max_users_notified_per_group_mention: 100, }) ); await fetchUnseenMentions({ names: ["valid_user", "mentionable_group", "valid_group", "invalid"], }); const root = domFromString(`