From a2ef6ff8b8cc17817e04012092c83ead5bae3c7a Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 10:33:10 +0100 Subject: [PATCH] test: clarify doctor config warning assertions --- src/commands/doctor-config-flow.test.ts | 36 +++++++++++++++---------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/commands/doctor-config-flow.test.ts b/src/commands/doctor-config-flow.test.ts index d63fe7a995a..969f7305354 100644 --- a/src/commands/doctor-config-flow.test.ts +++ b/src/commands/doctor-config-flow.test.ts @@ -1408,7 +1408,9 @@ describe("doctor config flow", () => { }, }, }); - expect(doctorWarnings.some((line) => line.includes("mutable allowlist"))).toBe(false); + expect(doctorWarnings).not.toEqual( + expect.arrayContaining([expect.stringContaining("mutable allowlist")]), + ); }); it("warns when hooks transformsDir points outside the hook transforms root", async () => { @@ -1533,14 +1535,16 @@ describe("doctor config flow", () => { }, }); - expect( - doctorWarnings.some((line) => - line.includes( + expect(doctorWarnings).toEqual( + expect.arrayContaining([ + expect.stringContaining( 'channels.telegram: channel is configured, but plugin "telegram" is disabled by plugins.entries.telegram.enabled=false.', ), - ), - ).toBe(true); - expect(doctorWarnings.some((line) => line.includes("first-time setup mode"))).toBe(false); + ]), + ); + expect(doctorWarnings).not.toEqual( + expect.arrayContaining([expect.stringContaining("first-time setup mode")]), + ); }); it("shows plugin-blocked guidance instead of first-time Telegram guidance when plugins are disabled globally", async () => { @@ -1556,14 +1560,16 @@ describe("doctor config flow", () => { }, }); - expect( - doctorWarnings.some((line) => - line.includes( + expect(doctorWarnings).toEqual( + expect.arrayContaining([ + expect.stringContaining( "channels.telegram: channel is configured, but plugins.enabled=false blocks channel plugins globally.", ), - ), - ).toBe(true); - expect(doctorWarnings.some((line) => line.includes("first-time setup mode"))).toBe(false); + ]), + ); + expect(doctorWarnings).not.toEqual( + expect.arrayContaining([expect.stringContaining("first-time setup mode")]), + ); }); it("warns on mutable Zalouser group entries when dangerous name matching is disabled", async () => { @@ -1597,7 +1603,9 @@ describe("doctor config flow", () => { }, }); - expect(doctorWarnings.some((line) => line.includes("channels.zalouser.groups"))).toBe(false); + expect(doctorWarnings).not.toEqual( + expect.arrayContaining([expect.stringContaining("channels.zalouser.groups")]), + ); }); it("warns when imessage group allowlist is empty even if allowFrom is set", async () => {