discourse/test/javascripts/integration/components/invite-panel-test.js
Robin Ward 435a9913a4 REFACTOR: Replace global find with queryAll
In newer Embers jQuery is removed. There is a `find` but it only returns
one element and not a jQuery selector. This patch migrates our code to a
new helper `queryAll` which allows us to remove the global.
2020-10-29 14:45:51 -04:00

25 lines
802 B
JavaScript

import EmberObject, { set } from "@ember/object";
import componentTest from "helpers/component-test";
import { moduleForComponent } from "ember-qunit";
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
moduleForComponent("invite-panel", { integration: true });
componentTest("can_invite_via_email", {
template: "{{invite-panel panel=panel}}",
beforeEach() {
set(this.currentUser, "details", { can_invite_via_email: true });
const inviteModel = JSON.parse(JSON.stringify(this.currentUser));
this.set("panel", {
id: "invite",
model: { inviteModel: EmberObject.create(inviteModel) },
});
},
async test(assert) {
await fillIn(".invite-user-input", "eviltrout@example.com");
assert.ok(queryAll(".send-invite:disabled").length === 0);
},
});