mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:49:33 +00:00
test: tighten relay smoke + slack token validation
This commit is contained in:
@@ -33,4 +33,39 @@ describe("Slack token config fields", () => {
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects invalid userTokenReadOnly types", () => {
|
||||
const res = validateConfigObject({
|
||||
channels: {
|
||||
slack: {
|
||||
botToken: "xoxb-any",
|
||||
appToken: "xapp-any",
|
||||
userToken: "xoxp-any",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
userTokenReadOnly: "no" as any,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(false);
|
||||
if (!res.ok) {
|
||||
expect(res.issues.some((iss) => iss.path.includes("userTokenReadOnly"))).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects invalid userToken types", () => {
|
||||
const res = validateConfigObject({
|
||||
channels: {
|
||||
slack: {
|
||||
botToken: "xoxb-any",
|
||||
appToken: "xapp-any",
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
userToken: 123 as any,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(false);
|
||||
if (!res.ok) {
|
||||
expect(res.issues.some((iss) => iss.path.includes("userToken"))).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user