mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 15:24:52 +09:00
Add test for sending user ban_reason
This commit is contained in:
1 parent
2496e756f1
commit
aadf24db99
1 file changed
+13
@@ -480,6 +480,10 @@ describe("Integration of Clusterio", function() {
|
||||
return new Map(result.list.map(user => [user.name, user]));
|
||||
}
|
||||
|
||||
async function getUser(name) {
|
||||
return await libLink.messages.getUser.send(getControl(), { name });
|
||||
}
|
||||
|
||||
let lists = ["admin", "whitelisted", "banned"];
|
||||
it("should add and remove the given user to the list", async function() {
|
||||
slowTest(this);
|
||||
@@ -522,6 +526,15 @@ describe("Integration of Clusterio", function() {
|
||||
}
|
||||
assert.equal(getControl().userUpdates.length, 3);
|
||||
});
|
||||
it("should send ban reason", async function() {
|
||||
slowTest(this);
|
||||
getControl().userUpdates = [];
|
||||
await execCtl("user set-banned --create test_ban_reason --reason a-reason");
|
||||
assert.equal(getControl().userUpdates.length, 1);
|
||||
assert.equal(getControl().userUpdates[0].ban_reason, "a-reason");
|
||||
let user = await getUser("test_ban_reason");
|
||||
assert.equal(user["ban_reason"], "a-reason");
|
||||
});
|
||||
});
|
||||
|
||||
describe("instance extract-players", function() {
|
||||
|
||||
Reference in new issue
Block a user