mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 20:38:21 +08:00
FIX: Properly reset controller of admin-user-index. (#6760)
This commit is contained in:

committed by
Régis Hanol

parent
1023003eba
commit
f0027961c7
43
test/javascripts/acceptance/admin-user-index-test.js.es6
Normal file
43
test/javascripts/acceptance/admin-user-index-test.js.es6
Normal file
@ -0,0 +1,43 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Admin - User Index", { loggedIn: true });
|
||||
|
||||
QUnit.test("can edit username", async assert => {
|
||||
/* global server */
|
||||
server.put("/users/sam/preferences/username", () => [
|
||||
200,
|
||||
{ "Content-Type": "application/json" },
|
||||
{ id: 2, username: "new-sam" }
|
||||
]);
|
||||
|
||||
await visit("/admin/users/2/sam");
|
||||
|
||||
assert.equal(
|
||||
find(".display-row.username .value")
|
||||
.text()
|
||||
.trim(),
|
||||
"sam"
|
||||
);
|
||||
|
||||
// Trying cancel.
|
||||
await click(".display-row.username button");
|
||||
await fillIn(".display-row.username .value input", "new-sam");
|
||||
await click(".display-row.username a");
|
||||
assert.equal(
|
||||
find(".display-row.username .value")
|
||||
.text()
|
||||
.trim(),
|
||||
"sam"
|
||||
);
|
||||
|
||||
// Doing edit.
|
||||
await click(".display-row.username button");
|
||||
await fillIn(".display-row.username .value input", "new-sam");
|
||||
await click(".display-row.username button");
|
||||
assert.equal(
|
||||
find(".display-row.username .value")
|
||||
.text()
|
||||
.trim(),
|
||||
"new-sam"
|
||||
);
|
||||
});
|
Reference in New Issue
Block a user