feat(settings): group commands by category in system tab

This commit is contained in:
syntaxbullet
2026-01-08 22:55:40 +01:00
parent 8fe300c8a2
commit bea6c33024
5 changed files with 56 additions and 28 deletions

View File

@@ -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");
});
});