From a76bebd2e68248315d7eb82d75ecc5b9eb8ff624 Mon Sep 17 00:00:00 2001 From: Shakker Date: Tue, 12 May 2026 21:27:46 +0100 Subject: [PATCH] test: etch discord status patches --- extensions/discord/src/channel.test.ts | 64 +++++++++++++++++--------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/extensions/discord/src/channel.test.ts b/extensions/discord/src/channel.test.ts index 434191cd68d..d8b0f6d0fbc 100644 --- a/extensions/discord/src/channel.test.ts +++ b/extensions/discord/src/channel.test.ts @@ -536,7 +536,7 @@ describe("discordPlugin outbound", () => { includeApplication: true, }), ); - expect(statusPatches.some((patch) => "bot" in patch || "application" in patch)).toBe(false); + expect(statusPatches.filter((patch) => "bot" in patch || "application" in patch)).toEqual([]); if (!resolveProbe) { throw new Error("Expected Discord startup probe resolver to be initialized"); @@ -550,12 +550,20 @@ describe("discordPlugin outbound", () => { await vi.waitFor(() => expect( - statusPatches.some( - (patch) => - (patch.bot as { username?: string } | undefined)?.username === "AsyncBob" && - Boolean(patch.application), - ), - ).toBe(true), + statusPatches + .filter( + (patch) => (patch.bot as { username?: string } | undefined)?.username === "AsyncBob", + ) + .map((patch) => ({ + bot: patch.bot, + application: patch.application, + })), + ).toEqual([ + { + bot: { username: "AsyncBob" }, + application: { intents: { messageContent: "limited" } }, + }, + ]), ); }); @@ -585,14 +593,19 @@ describe("discordPlugin outbound", () => { await vi.waitFor(() => expect( - statusPatches.some( - (patch) => - "bot" in patch && - "application" in patch && - patch.bot === undefined && - patch.application === undefined, - ), - ).toBe(true), + statusPatches + .filter( + (patch) => + "bot" in patch && + "application" in patch && + patch.bot === undefined && + patch.application === undefined, + ) + .map((patch) => ({ + bot: patch.bot, + application: patch.application, + })), + ).toEqual([{ bot: undefined, application: undefined }]), ); }); @@ -617,14 +630,19 @@ describe("discordPlugin outbound", () => { await vi.waitFor(() => expect( - statusPatches.some( - (patch) => - "bot" in patch && - "application" in patch && - patch.bot === undefined && - patch.application === undefined, - ), - ).toBe(true), + statusPatches + .filter( + (patch) => + "bot" in patch && + "application" in patch && + patch.bot === undefined && + patch.application === undefined, + ) + .map((patch) => ({ + bot: patch.bot, + application: patch.application, + })), + ).toEqual([{ bot: undefined, application: undefined }]), ); });