chore: Fix types in tests 44/N.

This commit is contained in:
cpojer
2026-02-17 15:49:00 +09:00
parent 688f86bf28
commit 52ad28e097
20 changed files with 44 additions and 32 deletions

View File

@@ -33,7 +33,10 @@ describe("handleDiscordPresenceAction", () => {
status: "online",
afk: false,
});
const payload = JSON.parse(result.content[0].text ?? "");
const textBlock = result.content.find((block) => block.type === "text");
const payload = JSON.parse(
(textBlock as { type: "text"; text: string } | undefined)?.text ?? "{}",
);
expect(payload.ok).toBe(true);
expect(payload.activities[0]).toEqual({ type: 0, name: "with fire" });
});