mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-15 18:48:40 +08:00
This was required in older versions of Ember. But now, bare template tags can access `this.`. This commit was created by upgrading lint-configs, and then running `pnpm lint:js:fix && pnpm lint:prettier:fix` Rule development: https://github.com/discourse/lint-configs/pull/154
22 lines
832 B
Text
22 lines
832 B
Text
import { click, render } from "@ember/test-helpers";
|
|
import { module, test } from "qunit";
|
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import ChatComposerDropdown from "discourse/plugins/chat/discourse/components/chat-composer-dropdown";
|
|
|
|
module("Discourse Chat | Component | chat-composer-dropdown", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("buttons", async function (assert) {
|
|
this.set("buttons", [{ id: "foo", icon: "xmark", action: () => {} }]);
|
|
|
|
await render(
|
|
<template><ChatComposerDropdown @buttons={{this.buttons}} /></template>
|
|
);
|
|
await click(".chat-composer-dropdown__trigger-btn");
|
|
|
|
assert.dom(".chat-composer-dropdown__item.foo").exists();
|
|
assert
|
|
.dom(".chat-composer-dropdown__action-btn.foo .d-icon-xmark")
|
|
.exists();
|
|
});
|
|
});
|