test: tighten shared card schema coverage

This commit is contained in:
Peter Steinberger
2026-03-24 17:02:56 -07:00
parent 639706f298
commit 561acd1675
3 changed files with 64 additions and 49 deletions

View File

@@ -576,17 +576,6 @@ describe("feishuPlugin actions", () => {
).rejects.toThrow("Feishu thread-reply requires messageId.");
});
it("declares card as optional in the tool schema", () => {
const discovery = feishuPlugin.actions?.describeMessageTool?.({ cfg });
const schema = Array.isArray(discovery?.schema) ? discovery.schema[0] : discovery?.schema;
const cardSchema = schema?.properties?.card;
expect(cardSchema).toBeDefined();
// TypeBox marks Optional schemas with Symbol(TypeBox.Optional) = "Optional".
expect(
(cardSchema as unknown as Record<symbol, unknown>)?.[Symbol.for("TypeBox.Optional")],
).toBe("Optional");
});
it("sends media-only messages without requiring card", async () => {
feishuOutboundSendMediaMock.mockResolvedValueOnce({
channel: "feishu",