mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 09:04:00 +08:00
dc3473fe06
1. `test()` and `render()` instead of `componentTest()` 2. Angle brackets 3. `strictEqual()`/`true()`/`false()` assertions This removes all remaining uses of `componentTest` from core
22 lines
674 B
JavaScript
22 lines
674 B
JavaScript
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import { exists } from "discourse/tests/helpers/qunit-helpers";
|
|
import hbs from "htmlbars-inline-precompile";
|
|
import { module, test } from "qunit";
|
|
import { render } from "@ember/test-helpers";
|
|
|
|
module("Discourse Chat | Component | chat-emoji-avatar", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("uses an emoji as avatar", async function (assert) {
|
|
this.set("emoji", ":otter:");
|
|
|
|
await render(hbs`<ChatEmojiAvatar @emoji={{this.emoji}} />`);
|
|
|
|
assert.true(
|
|
exists(
|
|
`.chat-emoji-avatar .chat-emoji-avatar-container .emoji[title=otter]`
|
|
)
|
|
);
|
|
});
|
|
});
|