2020-10-05 12:38:22 -04:00
|
|
|
import EmberObject, { set } from "@ember/object";
|
|
|
|
import componentTest from "helpers/component-test";
|
2020-10-28 16:36:01 -04:00
|
|
|
import { moduleForComponent } from "ember-qunit";
|
|
|
|
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
|
2020-10-05 12:38:22 -04:00
|
|
|
|
|
|
|
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");
|
2020-10-28 16:36:01 -04:00
|
|
|
assert.ok(queryAll(".send-invite:disabled").length === 0);
|
2020-10-05 12:38:22 -04:00
|
|
|
},
|
|
|
|
});
|