mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 09:08:14 +08:00
48193767bf
Automatically generated by `eslint --fix` to satisfy the updated configuration
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
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 | Unit | Helpers | tonable-emoji-title",
|
|
function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("When emoji is not tonable", async function (assert) {
|
|
this.set("emoji", { name: "foo", tonable: false });
|
|
this.set("diversity", 1);
|
|
await render(hbs`{{tonable-emoji-title this.emoji this.diversity}}`);
|
|
|
|
assert.equal(
|
|
document.querySelector("#ember-testing").innerText.trim(),
|
|
":foo:"
|
|
);
|
|
});
|
|
|
|
test("When emoji is tonable and diversity is 1", async function (assert) {
|
|
this.set("emoji", { name: "foo", tonable: true });
|
|
this.set("diversity", 1);
|
|
await render(hbs`{{tonable-emoji-title this.emoji this.diversity}}`);
|
|
|
|
assert.equal(
|
|
document.querySelector("#ember-testing").innerText.trim(),
|
|
":foo:"
|
|
);
|
|
});
|
|
|
|
test("When emoji is tonable and diversity is greater than 1", async function (assert) {
|
|
this.set("emoji", { name: "foo", tonable: true });
|
|
this.set("diversity", 2);
|
|
await render(hbs`{{tonable-emoji-title this.emoji this.diversity}}`);
|
|
|
|
assert.equal(
|
|
document.querySelector("#ember-testing").innerText.trim(),
|
|
":foo:t2:"
|
|
);
|
|
});
|
|
}
|
|
);
|