2022-12-22 08:35:18 -05:00
|
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
2022-11-02 09:41:30 -04:00
|
|
|
import { exists } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
import hbs from "htmlbars-inline-precompile";
|
2022-12-22 08:35:18 -05:00
|
|
|
import { module, test } from "qunit";
|
|
|
|
import { render } from "@ember/test-helpers";
|
2022-11-02 09:41:30 -04:00
|
|
|
|
|
|
|
module(
|
|
|
|
"Discourse Chat | Component | chat-composer-inline-buttons",
|
|
|
|
function (hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
2022-12-22 08:35:18 -05:00
|
|
|
test("buttons", async function (assert) {
|
|
|
|
this.set("buttons", [{ id: "foo", icon: "times", action: () => {} }]);
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2022-12-22 08:35:18 -05:00
|
|
|
await render(
|
|
|
|
hbs`<ChatComposerInlineButtons @buttons={{this.buttons}} />`
|
|
|
|
);
|
2022-11-02 09:41:30 -04:00
|
|
|
|
2022-12-22 08:35:18 -05:00
|
|
|
assert.true(exists(".chat-composer-inline-button.foo"));
|
|
|
|
assert.true(exists(".chat-composer-inline-button.foo .d-icon-times"));
|
2022-11-02 09:41:30 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|