From c53b11dccd6404ef86754f107741eee00c0031e0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 26 Feb 2026 21:24:50 +0000 Subject: [PATCH] test: fix pairing/daemon assertion drift --- extensions/feishu/src/bot.test.ts | 6 +++++- .../src/monitor-handler/message-handler.authz.test.ts | 5 ++++- extensions/nextcloud-talk/src/inbound.authz.test.ts | 5 ++++- src/cli/daemon-cli/status.gather.test.ts | 9 ++++++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/extensions/feishu/src/bot.test.ts b/extensions/feishu/src/bot.test.ts index 2679ce8e643..ca0792f2e82 100644 --- a/extensions/feishu/src/bot.test.ts +++ b/extensions/feishu/src/bot.test.ts @@ -239,7 +239,10 @@ describe("handleFeishuMessage command authorization", () => { await dispatchMessage({ cfg, event }); - expect(mockReadAllowFromStore).toHaveBeenCalledWith("feishu"); + expect(mockReadAllowFromStore).toHaveBeenCalledWith({ + channel: "feishu", + accountId: "default", + }); expect(mockResolveCommandAuthorizedFromAuthorizers).not.toHaveBeenCalled(); expect(mockFinalizeInboundContext).toHaveBeenCalledTimes(1); expect(mockDispatchReplyFromConfig).toHaveBeenCalledTimes(1); @@ -278,6 +281,7 @@ describe("handleFeishuMessage command authorization", () => { expect(mockUpsertPairingRequest).toHaveBeenCalledWith({ channel: "feishu", + accountId: "default", id: "ou-unapproved", meta: { name: undefined }, }); diff --git a/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts b/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts index 124599147a8..2be36f89732 100644 --- a/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts +++ b/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts @@ -90,7 +90,10 @@ describe("msteams monitor handler authz", () => { sendActivity: vi.fn(async () => undefined), } as unknown as Parameters[0]); - expect(readAllowFromStore).toHaveBeenCalledWith("msteams"); + expect(readAllowFromStore).toHaveBeenCalledWith({ + channel: "msteams", + accountId: "default", + }); expect(conversationStore.upsert).not.toHaveBeenCalled(); }); }); diff --git a/extensions/nextcloud-talk/src/inbound.authz.test.ts b/extensions/nextcloud-talk/src/inbound.authz.test.ts index 88a655ec442..6ceca861ad8 100644 --- a/extensions/nextcloud-talk/src/inbound.authz.test.ts +++ b/extensions/nextcloud-talk/src/inbound.authz.test.ts @@ -75,7 +75,10 @@ describe("nextcloud-talk inbound authz", () => { } as unknown as RuntimeEnv, }); - expect(readAllowFromStore).toHaveBeenCalledWith("nextcloud-talk"); + expect(readAllowFromStore).toHaveBeenCalledWith({ + channel: "nextcloud-talk", + accountId: "default", + }); expect(buildMentionRegexes).not.toHaveBeenCalled(); }); }); diff --git a/src/cli/daemon-cli/status.gather.test.ts b/src/cli/daemon-cli/status.gather.test.ts index 4544ada821a..1fcf65cdde9 100644 --- a/src/cli/daemon-cli/status.gather.test.ts +++ b/src/cli/daemon-cli/status.gather.test.ts @@ -119,9 +119,16 @@ describe("gatherDaemonStatus", () => { let envSnapshot: ReturnType; beforeEach(() => { - envSnapshot = captureEnv(["OPENCLAW_STATE_DIR", "OPENCLAW_CONFIG_PATH"]); + envSnapshot = captureEnv([ + "OPENCLAW_STATE_DIR", + "OPENCLAW_CONFIG_PATH", + "OPENCLAW_GATEWAY_TOKEN", + "OPENCLAW_GATEWAY_PASSWORD", + ]); process.env.OPENCLAW_STATE_DIR = "/tmp/openclaw-cli"; process.env.OPENCLAW_CONFIG_PATH = "/tmp/openclaw-cli/openclaw.json"; + delete process.env.OPENCLAW_GATEWAY_TOKEN; + delete process.env.OPENCLAW_GATEWAY_PASSWORD; callGatewayStatusProbe.mockClear(); loadGatewayTlsRuntime.mockClear(); });