test(extensions): move legacy schema assertions

This commit is contained in:
Peter Steinberger
2026-04-20 21:57:34 +01:00
parent 29a5ab9632
commit 8134fe737c
11 changed files with 237 additions and 270 deletions

View File

@@ -15,6 +15,28 @@ function expectSlackConfigIssue(config: unknown, path: string) {
}
describe("slack config schema", () => {
it("defaults groupPolicy to allowlist", () => {
const res = SlackConfigSchema.safeParse({});
expect(res.success).toBe(true);
if (res.success) {
expect(res.data.groupPolicy).toBe("allowlist");
}
});
it("accepts historyLimit overrides per account", () => {
const res = SlackConfigSchema.safeParse({
historyLimit: 7,
accounts: { ops: { historyLimit: 2 } },
});
expect(res.success).toBe(true);
if (res.success) {
expect(res.data.historyLimit).toBe(7);
expect(res.data.accounts?.ops?.historyLimit).toBe(2);
}
});
it('rejects dmPolicy="open" without allowFrom "*"', () => {
expectSlackConfigIssue(
{