mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test: fix pairing/daemon assertion drift
This commit is contained in:
@@ -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 },
|
||||
});
|
||||
|
||||
@@ -90,7 +90,10 @@ describe("msteams monitor handler authz", () => {
|
||||
sendActivity: vi.fn(async () => undefined),
|
||||
} as unknown as Parameters<typeof handler>[0]);
|
||||
|
||||
expect(readAllowFromStore).toHaveBeenCalledWith("msteams");
|
||||
expect(readAllowFromStore).toHaveBeenCalledWith({
|
||||
channel: "msteams",
|
||||
accountId: "default",
|
||||
});
|
||||
expect(conversationStore.upsert).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -119,9 +119,16 @@ describe("gatherDaemonStatus", () => {
|
||||
let envSnapshot: ReturnType<typeof captureEnv>;
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user