mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 13:24:58 +00:00
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: chilu18 <7957943+chilu18@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeCompatibilityConfigValues } from "./doctor-legacy-config.js";
|
|
|
|
describe("normalizeCompatibilityConfigValues preview streaming aliases", () => {
|
|
it("normalizes telegram boolean streaming aliases to enum", () => {
|
|
const res = normalizeCompatibilityConfigValues({
|
|
channels: {
|
|
telegram: {
|
|
streaming: false,
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(res.config.channels?.telegram?.streaming).toBe("off");
|
|
expect(res.config.channels?.telegram?.streamMode).toBeUndefined();
|
|
expect(res.changes).toEqual(["Normalized channels.telegram.streaming boolean → enum (off)."]);
|
|
});
|
|
|
|
it("normalizes discord boolean streaming aliases to enum", () => {
|
|
const res = normalizeCompatibilityConfigValues({
|
|
channels: {
|
|
discord: {
|
|
streaming: true,
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(res.config.channels?.discord?.streaming).toBe("partial");
|
|
expect(res.config.channels?.discord?.streamMode).toBeUndefined();
|
|
expect(res.changes).toEqual([
|
|
"Normalized channels.discord.streaming boolean → enum (partial).",
|
|
]);
|
|
});
|
|
|
|
it("normalizes slack boolean streaming aliases to enum and native streaming", () => {
|
|
const res = normalizeCompatibilityConfigValues({
|
|
channels: {
|
|
slack: {
|
|
streaming: false,
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(res.config.channels?.slack?.streaming).toBe("off");
|
|
expect(res.config.channels?.slack?.nativeStreaming).toBe(false);
|
|
expect(res.config.channels?.slack?.streamMode).toBeUndefined();
|
|
expect(res.changes).toEqual([
|
|
"Moved channels.slack.streaming (boolean) → channels.slack.nativeStreaming (false).",
|
|
]);
|
|
});
|
|
});
|