From 52fb51db778938c258d39eea2363f51d4e62fc63 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 3 Apr 2026 20:39:08 +0100 Subject: [PATCH] fix(ci): update whatsapp setup status mock signature --- extensions/whatsapp/src/setup-surface.test.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/extensions/whatsapp/src/setup-surface.test.ts b/extensions/whatsapp/src/setup-surface.test.ts index 7653646e76e..0ea3e6cc9d1 100644 --- a/extensions/whatsapp/src/setup-surface.test.ts +++ b/extensions/whatsapp/src/setup-surface.test.ts @@ -10,7 +10,9 @@ import { whatsappSetupPlugin } from "./channel.setup.js"; import { whatsappSetupWizard } from "./setup-surface.js"; const hoisted = vi.hoisted(() => ({ - detectWhatsAppLinked: vi.fn(async () => false), + detectWhatsAppLinked: vi.fn<(cfg: OpenClawConfig, accountId: string) => Promise>( + async () => false, + ), loginWeb: vi.fn(async () => {}), pathExists: vi.fn(async () => false), resolveWhatsAppAuthDir: vi.fn(() => ({ @@ -182,10 +184,7 @@ describe("whatsapp setup wizard", () => { expect(named.cfg.channels?.whatsapp?.dmPolicy).toBe("disabled"); expect(named.cfg.channels?.whatsapp?.allowFrom).toEqual(["+15555550123"]); expect(named.cfg.channels?.whatsapp?.accounts?.work?.dmPolicy).toBe("open"); - expect(named.cfg.channels?.whatsapp?.accounts?.work?.allowFrom).toEqual([ - "*", - "+15555550123", - ]); + expect(named.cfg.channels?.whatsapp?.accounts?.work?.allowFrom).toEqual(["*", "+15555550123"]); expect(harness.note).toHaveBeenCalledWith( expect.stringContaining( "`channels.whatsapp.accounts.work.dmPolicy` + `channels.whatsapp.accounts.work.allowFrom`", @@ -217,7 +216,9 @@ describe("whatsapp setup wizard", () => { }); it("uses configured defaultAccount for omitted-account setup status", async () => { - hoisted.detectWhatsAppLinked.mockImplementation(async (_cfg, accountId) => accountId === "work"); + hoisted.detectWhatsAppLinked.mockImplementation( + async (_cfg: OpenClawConfig, accountId: string) => accountId === "work", + ); const status = await whatsappGetStatus({ cfg: { @@ -240,10 +241,7 @@ describe("whatsapp setup wizard", () => { expect(status.configured).toBe(true); expect(status.statusLines).toEqual(["WhatsApp (work): linked"]); - expect(hoisted.detectWhatsAppLinked).toHaveBeenCalledWith( - expect.any(Object), - "work", - ); + expect(hoisted.detectWhatsAppLinked).toHaveBeenCalledWith(expect.any(Object), "work"); expect(hoisted.detectWhatsAppLinked).not.toHaveBeenCalledWith( expect.any(Object), DEFAULT_ACCOUNT_ID,