test: tighten relay smoke + slack token validation

This commit is contained in:
Peter Steinberger
2026-02-16 01:45:10 +00:00
parent 4d9e310dad
commit 014d45f7ee
2 changed files with 56 additions and 0 deletions

View File

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