import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import hbs from "htmlbars-inline-precompile";
import { exists } from "discourse/tests/helpers/qunit-helpers";
import { module, test } from "qunit";
import { render } from "@ember/test-helpers";
module("Discourse Chat | Component | chat-message-text", function (hooks) {
setupRenderingTest(hooks);
test("yields", async function (assert) {
this.set("cooked", "
");
await render(hbs`
`);
assert.true(exists(".yield-me"));
});
test("shows collapsed", async function (assert) {
this.set(
"cooked",
''
);
await render(
hbs``
);
assert.true(exists(".chat-message-collapser"));
});
test("does not collapse a non-image onebox", async function (assert) {
this.set("cooked", '
');
await render(hbs``);
assert.false(exists(".chat-message-collapser"));
});
test("shows edits - regular message", async function (assert) {
this.set("cooked", "");
await render(
hbs``
);
assert.true(exists(".chat-message-edited"));
});
test("shows edits - collapsible message", async function (assert) {
this.set("cooked", '');
await render(
hbs``
);
assert.true(exists(".chat-message-edited"));
});
});