mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 21:12:49 +08:00
test(perm): assert /me capabilities+bots; dry backfill token list
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d70664067c
commit
1ca1ca9d0c
2 files changed
+8
-1
No files matched your search
@@ -102,6 +102,12 @@ describe("session router", () => {
|
||||
const me = await request(app).get("/api/session/me").set("Cookie", cookie);
|
||||
expect(me.status).toBe(200);
|
||||
expect(me.body.username).toBe("alice");
|
||||
// alice is the first user (an admin), so /me exposes all capabilities and full bot access.
|
||||
expect(Array.isArray(me.body.capabilities)).toBe(true);
|
||||
expect(me.body.capabilities).toEqual(
|
||||
expect.arrayContaining(["player.control", "player.queue", "bot.manage", "platform.auth", "quality"])
|
||||
);
|
||||
expect(me.body.bots).toBe("all");
|
||||
|
||||
const anon = await request(app).get("/api/session/me");
|
||||
expect(anon.status).toBe(401);
|
||||
|
||||
Reference in new issue
Block a user