feat(settings): group commands by category in system tab
This commit is contained in:
@@ -62,7 +62,11 @@ mock.module("../../bot/lib/BotClient", () => ({
|
||||
commands: [
|
||||
{ data: { name: "ping" } }
|
||||
],
|
||||
knownCommands: new Set(["ping", "help", "disabled-cmd"])
|
||||
knownCommands: new Map([
|
||||
["ping", "utility"],
|
||||
["help", "utility"],
|
||||
["disabled-cmd", "admin"]
|
||||
])
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -156,6 +160,11 @@ describe("Settings API", () => {
|
||||
expect(data.roles).toHaveLength(2);
|
||||
expect(data.roles[0]).toEqual({ id: "role1", name: "Admin", color: "#ffffff" });
|
||||
expect(data.channels[0]).toEqual({ id: "chan1", name: "general", type: 0 });
|
||||
expect(data.commands).toContain("ping");
|
||||
|
||||
// Check new commands structure
|
||||
expect(data.commands).toBeArray();
|
||||
expect(data.commands.length).toBeGreaterThan(0);
|
||||
expect(data.commands[0]).toHaveProperty("name");
|
||||
expect(data.commands[0]).toHaveProperty("category");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user