mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Add tests for invite system (#12524)
This commit is contained in:
@ -1,24 +0,0 @@
|
||||
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);
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user