mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 21:16:14 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
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")
|
|
);
|
|
},
|
|
});
|
|
});
|