test: clarify lazy web auth string reads

This commit is contained in:
Peter Steinberger
2026-04-11 00:43:08 +01:00
parent 39553b1b4b
commit 2b45a90f71

View File

@@ -1,6 +1,8 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { normalizeChatType } from "./chat-type.js";
const readLazyString = (value: unknown): string => String(value);
describe("normalizeChatType", () => {
it.each([
{ name: "normalizes direct", value: "direct", expected: "direct" },
@@ -61,8 +63,8 @@ describe("WA_WEB_AUTH_DIR", () => {
const webEntry = await import("./web/index.js");
expect(resolveWebChannelAuthDir).not.toHaveBeenCalled();
expect(String(channelWeb.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
expect(String(webEntry.WA_WEB_AUTH_DIR)).toBe("/tmp/openclaw-whatsapp-auth");
expect(readLazyString(channelWeb.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);
});
});