mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Automatically generated by `eslint --fix` to satisfy the updated configuration
30 lines
986 B
JavaScript
30 lines
986 B
JavaScript
import { render } from "@ember/test-helpers";
|
|
import { hbs } from "ember-cli-htmlbars";
|
|
import { module, test } from "qunit";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
|
|
module("Integration | Helper | replace-emoji", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("it replaces the emoji", async function (assert) {
|
|
await render(hbs`<span>{{replace-emoji "some text :heart:"}}</span>`);
|
|
|
|
assert.dom(`span`).includesText("some text");
|
|
assert.dom(`.emoji[title="heart"]`).exists();
|
|
});
|
|
|
|
test("it escapes the text", async function (assert) {
|
|
await render(
|
|
hbs`<span>{{replace-emoji "<style>body: {background: red;}</style>"}}</span>`
|
|
);
|
|
|
|
assert.dom(`span`).hasText("<style>body: {background: red;}</style>");
|
|
});
|
|
|
|
test("it renders html-safe text", async function (assert) {
|
|
await render(hbs`<span>{{replace-emoji (html-safe "safe text")}}</span>`);
|
|
|
|
assert.dom(`span`).hasText("safe text");
|
|
});
|
|
});
|