mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
test: tighten tools catalog assertions
This commit is contained in:
@@ -30,8 +30,8 @@ function expectWrittenSkillEntry(skillKey: string, entry: unknown) {
|
||||
entries?: Record<string, unknown>;
|
||||
};
|
||||
};
|
||||
expect(Object.keys(config).sort()).toEqual(["skills"]);
|
||||
expect(Object.keys(config.skills ?? {}).sort()).toEqual(["entries"]);
|
||||
expect(Object.keys(config).toSorted()).toEqual(["skills"]);
|
||||
expect(Object.keys(config.skills ?? {}).toSorted()).toEqual(["entries"]);
|
||||
expect(config.skills?.entries?.[skillKey]).toEqual(entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -124,11 +124,9 @@ describe("tools.catalog handler", () => {
|
||||
const voiceCall = pluginGroups
|
||||
.flatMap((group) => group.tools)
|
||||
.find((tool) => tool.id === "voice_call");
|
||||
expect(voiceCall).toMatchObject({
|
||||
source: "plugin",
|
||||
pluginId: "voice-call",
|
||||
optional: true,
|
||||
});
|
||||
expect(voiceCall?.source).toBe("plugin");
|
||||
expect(voiceCall?.pluginId).toBe("voice-call");
|
||||
expect(voiceCall?.optional).toBe(true);
|
||||
});
|
||||
|
||||
it("summarizes plugin tool descriptions the same way as the effective inventory", async () => {
|
||||
@@ -159,15 +157,12 @@ describe("tools.catalog handler", () => {
|
||||
|
||||
await invoke();
|
||||
|
||||
expect(vi.mocked(resolvePluginTools)).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
allowGatewaySubagentBinding: true,
|
||||
}),
|
||||
);
|
||||
expect(vi.mocked(ensureStandalonePluginToolRegistryLoaded)).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
allowGatewaySubagentBinding: true,
|
||||
}),
|
||||
expect(vi.mocked(resolvePluginTools).mock.calls[0]?.[0]?.allowGatewaySubagentBinding).toBe(
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
vi.mocked(ensureStandalonePluginToolRegistryLoaded).mock.calls[0]?.[0]
|
||||
?.allowGatewaySubagentBinding,
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user