import { render } from "@ember/test-helpers"; import hbs from "htmlbars-inline-precompile"; import { module, test } from "qunit"; import { setupRenderingTest } from "discourse/tests/helpers/component-test"; module("Discourse Chat | Component | chat-message-text", function (hooks) { setupRenderingTest(hooks); test("yields", async function (assert) { this.set("cooked", "

"); await render(hbs`
`); assert.dom(".yield-me").exists(); }); test("shows collapsed", async function (assert) { this.set( "cooked", '
' ); await render( hbs`` ); assert.dom(".chat-message-collapser").exists(); }); test("does not collapse a non-image onebox", async function (assert) { this.set("cooked", '

'); await render(hbs``); assert.dom(".chat-message-collapser").doesNotExist(); }); test("shows edits - regular message", async function (assert) { this.set("cooked", "

"); await render( hbs`` ); assert.dom(".chat-message-edited").exists(); }); test("shows edits - collapsible message", async function (assert) { this.set( "cooked", '
' ); await render( hbs`` ); assert.dom(".chat-message-edited").exists(); }); });