mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
Merge remote-tracking branch 'origin/master' into host-pairing
This commit is contained in:
3 files changed
+93
-45
No files matched your search
@@ -52,6 +52,20 @@ describe("messages/controller", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("RoleDeleteRequest", function() {
|
||||
it("removes the role from users and sends a user update", async function() {
|
||||
const id = await controlConnection.handleRoleCreateRequest(new lib.RoleCreateRequest("r", "", []));
|
||||
const user = controller.users.getOrCreateUser("player");
|
||||
user.addRole(id);
|
||||
const updated = [];
|
||||
controller.users.records.on("update", users => updated.push(...users));
|
||||
await controlConnection.handleRoleDeleteRequest(new lib.RoleDeleteRequest(id));
|
||||
assert.equal(controller.roles.has(id), false);
|
||||
assert.equal(user.roleIds.has(id), false);
|
||||
assert(updated.some(u => u.name === "player" && !u.roleIds.has(id)), "no user update sent");
|
||||
});
|
||||
});
|
||||
|
||||
describe("ControllerConfigGetRequest", function() {
|
||||
it("runs", async function() {
|
||||
const config = await controlConnection.handleControllerConfigGetRequest(
|
||||
|
||||
Reference in new issue
Block a user