fix: add object capabilities coverage (#1071) (thanks @danielz1z)
This commit is contained in:
1 parent
be6536a635
commit
3ab4c3a3c4
4 files changed
+29
-4
No files matched your search
@@ -125,6 +125,29 @@ describe("resolveChannelCapabilities", () => {
|
||||
}),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("falls back to channel capabilities when account capabilities use object format", () => {
|
||||
const cfg = {
|
||||
channels: {
|
||||
telegram: {
|
||||
capabilities: ["inlineButtons"],
|
||||
accounts: {
|
||||
default: {
|
||||
capabilities: { inlineButtons: "dm" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies Partial<ClawdbotConfig>;
|
||||
|
||||
expect(
|
||||
resolveChannelCapabilities({
|
||||
cfg: cfg as ClawdbotConfig,
|
||||
channel: "telegram",
|
||||
accountId: "default",
|
||||
}),
|
||||
).toEqual(["inlineButtons"]);
|
||||
});
|
||||
});
|
||||
|
||||
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
|
||||
|
||||
Reference in new issue
Block a user