From fbaa7a34faafb01a04fab90bd8c8b2ffae961a97 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 12 Apr 2026 12:17:20 -0700 Subject: [PATCH] test: stabilize doctor streaming migration expectations --- src/commands/doctor-config-flow.test.ts | 2 +- .../doctor-legacy-config.migrations.test.ts | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/commands/doctor-config-flow.test.ts b/src/commands/doctor-config-flow.test.ts index 0e0cfc2bb3e..4cddc38e18c 100644 --- a/src/commands/doctor-config-flow.test.ts +++ b/src/commands/doctor-config-flow.test.ts @@ -1022,7 +1022,7 @@ describe("doctor config flow", () => { }; }; }; - expect(cfg.channels.discord.streaming).toBe(true); + expect(cfg.channels.discord.streaming).toEqual({ mode: "partial" }); expect(cfg.channels.discord.streamMode).toBeUndefined(); expect(cfg.channels.discord.lifecycle).toEqual({ enabled: true, diff --git a/src/commands/doctor-legacy-config.migrations.test.ts b/src/commands/doctor-legacy-config.migrations.test.ts index e61de14cc0f..c29ac1c8cb6 100644 --- a/src/commands/doctor-legacy-config.migrations.test.ts +++ b/src/commands/doctor-legacy-config.migrations.test.ts @@ -150,16 +150,19 @@ describe("normalizeCompatibilityConfigValues", () => { }), ); - expect(res.config.channels?.discord?.streaming).toBe(true); + expect(res.config.channels?.discord?.streaming).toEqual({ mode: "partial" }); expect(getLegacyProperty(res.config.channels?.discord, "streamMode")).toBeUndefined(); - expect(res.config.channels?.discord?.accounts?.work?.streaming).toBe(false); + expect(res.config.channels?.discord?.accounts?.work?.streaming).toEqual({ mode: "off" }); expect( getLegacyProperty(res.config.channels?.discord?.accounts?.work, "streamMode"), ).toBeUndefined(); - expect(res.changes).toEqual([]); + expect(res.changes).toEqual([ + "Moved channels.discord.streaming (boolean) → channels.discord.streaming.mode (partial).", + "Moved channels.discord.accounts.work.streaming (boolean) → channels.discord.accounts.work.streaming.mode (off).", + ]); }); - it("keeps Discord legacy streamMode untouched", () => { + it("migrates Discord legacy streamMode into nested streaming.mode", () => { const res = normalizeCompatibilityConfigValues( asLegacyConfig({ channels: { @@ -171,9 +174,11 @@ describe("normalizeCompatibilityConfigValues", () => { }), ); - expect(res.config.channels?.discord?.streaming).toBe(false); - expect(getLegacyProperty(res.config.channels?.discord, "streamMode")).toBe("block"); - expect(res.changes).toEqual([]); + expect(res.config.channels?.discord?.streaming).toEqual({ mode: "block" }); + expect(getLegacyProperty(res.config.channels?.discord, "streamMode")).toBeUndefined(); + expect(res.changes).toEqual([ + "Moved channels.discord.streamMode → channels.discord.streaming.mode (block).", + ]); }); it("migrates Telegram streamMode into nested streaming.mode", () => {