mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-09 00:01:17 +00:00
30 lines
863 B
TypeScript
30 lines
863 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveIMessageAccount } from "./accounts.js";
|
|
|
|
describe("resolveIMessageAccount", () => {
|
|
it("uses configured defaultAccount when accountId is omitted", () => {
|
|
const resolved = resolveIMessageAccount({
|
|
cfg: {
|
|
channels: {
|
|
imessage: {
|
|
defaultAccount: "work",
|
|
accounts: {
|
|
work: {
|
|
name: "Work",
|
|
cliPath: "/usr/local/bin/imsg-work",
|
|
dmPolicy: "open",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
} as never,
|
|
});
|
|
|
|
expect(resolved.accountId).toBe("work");
|
|
expect(resolved.name).toBe("Work");
|
|
expect(resolved.config.cliPath).toBe("/usr/local/bin/imsg-work");
|
|
expect(resolved.config.dmPolicy).toBe("open");
|
|
expect(resolved.configured).toBe(true);
|
|
});
|
|
});
|