mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-26 12:26:38 -06:00
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// Nextcloud Talk tests cover accounts plugin behavior.
|
|
import { describe, expect, it } from "vitest";
|
|
import {
|
|
listNextcloudTalkAccountIds,
|
|
resolveDefaultNextcloudTalkAccountId,
|
|
resolveNextcloudTalkAccount,
|
|
} from "./accounts.js";
|
|
import type { CoreConfig } from "./types.js";
|
|
|
|
describe("Nextcloud Talk account resolution", () => {
|
|
it("preserves top-level default account when named accounts are configured", () => {
|
|
const cfg = {
|
|
channels: {
|
|
"nextcloud-talk": {
|
|
baseUrl: "https://cloud.example.com",
|
|
botSecret: "shared-secret",
|
|
accounts: {
|
|
work: { enabled: false },
|
|
},
|
|
},
|
|
},
|
|
} satisfies CoreConfig;
|
|
|
|
expect(listNextcloudTalkAccountIds(cfg)).toEqual(["default", "work"]);
|
|
expect(resolveDefaultNextcloudTalkAccountId(cfg)).toBe("default");
|
|
expect(resolveNextcloudTalkAccount({ cfg })).toMatchObject({
|
|
accountId: "default",
|
|
baseUrl: "https://cloud.example.com",
|
|
secret: "shared-secret",
|
|
});
|
|
});
|
|
});
|