mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 13:53:44 +08:00
29 lines
859 B
JavaScript
29 lines
859 B
JavaScript
|
import componentTest, {
|
||
|
setupRenderingTest,
|
||
|
} from "discourse/tests/helpers/component-test";
|
||
|
import { exists } from "discourse/tests/helpers/qunit-helpers";
|
||
|
import hbs from "htmlbars-inline-precompile";
|
||
|
import { click } from "@ember/test-helpers";
|
||
|
import { module } from "qunit";
|
||
|
|
||
|
module("Discourse Chat | Component | chat-composer-dropdown", function (hooks) {
|
||
|
setupRenderingTest(hooks);
|
||
|
|
||
|
componentTest("buttons", {
|
||
|
template: hbs`{{chat-composer-dropdown buttons=buttons}}`,
|
||
|
|
||
|
async beforeEach() {
|
||
|
this.set("buttons", [{ id: "foo", icon: "times", action: () => {} }]);
|
||
|
},
|
||
|
|
||
|
async test(assert) {
|
||
|
await click(".chat-composer-dropdown__trigger-btn");
|
||
|
|
||
|
assert.ok(exists(".chat-composer-dropdown__item.foo"));
|
||
|
assert.ok(
|
||
|
exists(".chat-composer-dropdown__action-btn.foo .d-icon-times")
|
||
|
);
|
||
|
},
|
||
|
});
|
||
|
});
|