Add test for sending user ban_reason

This commit is contained in:
Hornwitser committed 2022-07-16 14:30:06 +02:00
1 parent 2496e756f1
commit aadf24db99
1 file changed
+13
+13
View File
@@ -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() {