Refactor user suspension modal
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user