mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 06:23:43 +08:00
37 lines
1015 B
JavaScript
37 lines
1015 B
JavaScript
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Admin - Suspend User", { loggedIn: true });
|
|
|
|
QUnit.test("suspend a user - cancel", assert => {
|
|
visit("/admin/users/1234/regular");
|
|
click(".suspend-user");
|
|
|
|
andThen(() => {
|
|
assert.equal(find('.suspend-user-modal:visible').length, 1);
|
|
});
|
|
|
|
click('.d-modal-cancel');
|
|
andThen(() => {
|
|
assert.equal(find('.suspend-user-modal:visible').length, 0);
|
|
});
|
|
});
|
|
|
|
QUnit.test("suspend a user", assert => {
|
|
visit("/admin/users/1234/regular");
|
|
click(".suspend-user");
|
|
|
|
andThen(() => {
|
|
assert.equal(find('.perform-suspend[disabled]').length, 1, 'disabled by default');
|
|
});
|
|
fillIn('.suspend-duration', 12);
|
|
fillIn('.suspend-reason', "for breaking the rules");
|
|
fillIn('.suspend-message', "this is an email reason why");
|
|
andThen(() => {
|
|
assert.equal(find('.perform-suspend[disabled]').length, 0);
|
|
});
|
|
click('.perform-suspend');
|
|
andThen(() => {
|
|
assert.equal(find('.suspend-user-modal:visible').length, 0);
|
|
});
|
|
});
|