mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-18 04:01:03 +00:00
test: tighten discord voice access assertions
This commit is contained in:
@@ -62,8 +62,25 @@ describe("authorizeDiscordVoiceIngress", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(access).toMatchObject({ ok: true });
|
||||
expect(access.ok && access.channelConfig?.users).toEqual(["discord:u-owner"]);
|
||||
expect(access).toEqual({
|
||||
ok: true,
|
||||
channelConfig: {
|
||||
allowed: true,
|
||||
requireMention: undefined,
|
||||
ignoreOtherMentions: undefined,
|
||||
skills: undefined,
|
||||
enabled: undefined,
|
||||
users: ["discord:u-owner"],
|
||||
roles: undefined,
|
||||
systemPrompt: undefined,
|
||||
includeThreadStarter: undefined,
|
||||
autoThread: undefined,
|
||||
autoThreadName: undefined,
|
||||
autoArchiveDuration: undefined,
|
||||
matchKey: "c1",
|
||||
matchSource: "direct",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("allows slug-keyed guild configs when manager context only has guild name", async () => {
|
||||
@@ -92,7 +109,25 @@ describe("authorizeDiscordVoiceIngress", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(access).toMatchObject({ ok: true });
|
||||
expect(access).toEqual({
|
||||
ok: true,
|
||||
channelConfig: {
|
||||
allowed: true,
|
||||
requireMention: undefined,
|
||||
ignoreOtherMentions: undefined,
|
||||
skills: undefined,
|
||||
enabled: undefined,
|
||||
users: ["discord:u-owner"],
|
||||
roles: undefined,
|
||||
systemPrompt: undefined,
|
||||
includeThreadStarter: undefined,
|
||||
autoThread: undefined,
|
||||
autoThreadName: undefined,
|
||||
autoArchiveDuration: undefined,
|
||||
matchKey: "*",
|
||||
matchSource: "wildcard",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("allows wildcard guild configs when only the guild id is available", async () => {
|
||||
@@ -120,7 +155,25 @@ describe("authorizeDiscordVoiceIngress", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(access).toMatchObject({ ok: true });
|
||||
expect(access).toEqual({
|
||||
ok: true,
|
||||
channelConfig: {
|
||||
allowed: true,
|
||||
requireMention: undefined,
|
||||
ignoreOtherMentions: undefined,
|
||||
skills: undefined,
|
||||
enabled: undefined,
|
||||
users: ["discord:u-owner"],
|
||||
roles: undefined,
|
||||
systemPrompt: undefined,
|
||||
includeThreadStarter: undefined,
|
||||
autoThread: undefined,
|
||||
autoThreadName: undefined,
|
||||
autoArchiveDuration: undefined,
|
||||
matchKey: "*",
|
||||
matchSource: "wildcard",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("blocks commands when channel id is unavailable for an allowlisted channel", async () => {
|
||||
@@ -212,6 +265,24 @@ describe("authorizeDiscordVoiceIngress", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(access).toMatchObject({ ok: true });
|
||||
expect(access).toEqual({
|
||||
ok: true,
|
||||
channelConfig: {
|
||||
allowed: true,
|
||||
requireMention: undefined,
|
||||
ignoreOtherMentions: undefined,
|
||||
skills: undefined,
|
||||
enabled: undefined,
|
||||
users: undefined,
|
||||
roles: undefined,
|
||||
systemPrompt: undefined,
|
||||
includeThreadStarter: undefined,
|
||||
autoThread: undefined,
|
||||
autoThreadName: undefined,
|
||||
autoArchiveDuration: undefined,
|
||||
matchKey: "c1",
|
||||
matchSource: "direct",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user