mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 22:10:21 +00:00
test: clarify lazy web auth string reads
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
import { normalizeChatType } from "./chat-type.js";
|
import { normalizeChatType } from "./chat-type.js";
|
||||||
|
|
||||||
|
const readLazyString = (value: unknown): string => String(value);
|
||||||
|
|
||||||
describe("normalizeChatType", () => {
|
describe("normalizeChatType", () => {
|
||||||
it.each([
|
it.each([
|
||||||
{ name: "normalizes direct", value: "direct", expected: "direct" },
|
{ name: "normalizes direct", value: "direct", expected: "direct" },
|
||||||
@@ -61,8 +63,8 @@ describe("WA_WEB_AUTH_DIR", () => {
|
|||||||
const webEntry = await import("./web/index.js");
|
const webEntry = await import("./web/index.js");
|
||||||
|
|
||||||
expect(resolveWebChannelAuthDir).not.toHaveBeenCalled();
|
expect(resolveWebChannelAuthDir).not.toHaveBeenCalled();
|
||||||
expect(String(channelWeb.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
|
expect(readLazyString(channelWeb.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
|
||||||
expect(String(webEntry.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
|
expect(readLazyString(webEntry.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
|
||||||
expect(resolveWebChannelAuthDir).toHaveBeenCalledTimes(1);
|
expect(resolveWebChannelAuthDir).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user