discourse/plugins/discourse-chat-integration/test/javascripts/acceptance/transcript-test.js
Jarek Radosz 893fcf714b
DEV: Remove plugin names from test titles (#39418)
Those are now automatically included in testem's output.
2026-04-21 19:19:52 +02:00

37 lines
943 B
JavaScript

import { settled, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
/**
* Workaround for https://github.com/tildeio/router.js/pull/335
*/
async function visitWithRedirects(url) {
try {
await visit(url);
} catch (error) {
const { message } = error;
if (message !== "TransitionAborted") {
throw error;
}
await settled();
}
}
acceptance("slack transcript", function (needs) {
needs.user({
can_create_topic: true,
});
needs.pretender((server, helper) => {
server.get("/chat-transcript/abcde", () => {
return helper.response({
content: "This is a chat transcript",
});
});
});
test("Can open composer with transcript", async function (assert) {
await visitWithRedirects("/chat-transcript/abcde");
assert.dom(".d-editor-input").hasValue("This is a chat transcript");
});
});