mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 22:08:33 +08:00
36 lines
954 B
Plaintext
36 lines
954 B
Plaintext
|
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('.cancel-suspend');
|
||
|
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");
|
||
|
andThen(() => {
|
||
|
assert.equal(find('.perform-suspend[disabled]').length, 0);
|
||
|
});
|
||
|
click('.perform-suspend');
|
||
|
andThen(() => {
|
||
|
assert.equal(find('.suspend-user-modal:visible').length, 0);
|
||
|
});
|
||
|
});
|