test: tighten tools catalog assertions

This commit is contained in:
Peter Steinberger
2026-05-11 13:41:35 +01:00
parent 29f85ca246
commit 26b32601f0
2 changed files with 11 additions and 16 deletions
@@ -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);
});
});