mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 09:04:01 +08:00
dc3473fe06
1. `test()` and `render()` instead of `componentTest()` 2. Angle brackets 3. `strictEqual()`/`true()`/`false()` assertions This removes all remaining uses of `componentTest` from core
22 lines
809 B
JavaScript
22 lines
809 B
JavaScript
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
|
import { exists } from "discourse/tests/helpers/qunit-helpers";
|
|
import hbs from "htmlbars-inline-precompile";
|
|
import { click, render } from "@ember/test-helpers";
|
|
import { module, test } from "qunit";
|
|
|
|
module("Discourse Chat | Component | chat-composer-dropdown", function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
|
|
test("buttons", async function (assert) {
|
|
this.set("buttons", [{ id: "foo", icon: "times", action: () => {} }]);
|
|
|
|
await render(hbs`<ChatComposerDropdown @buttons={{this.buttons}} />`);
|
|
await click(".chat-composer-dropdown__trigger-btn");
|
|
|
|
assert.true(exists(".chat-composer-dropdown__item.foo"));
|
|
assert.true(
|
|
exists(".chat-composer-dropdown__action-btn.foo .d-icon-times")
|
|
);
|
|
});
|
|
});
|