mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +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 { 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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user