From 07903fa572b66b22c8214778ea7b26cef9ba045e Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 00:33:43 +0100 Subject: [PATCH] test: tighten msteams outbound poll assertion --- extensions/msteams/src/outbound.test.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/extensions/msteams/src/outbound.test.ts b/extensions/msteams/src/outbound.test.ts index 629115d16af..7fb690b7231 100644 --- a/extensions/msteams/src/outbound.test.ts +++ b/extensions/msteams/src/outbound.test.ts @@ -138,13 +138,18 @@ describe("msteamsOutbound cfg threading", () => { options: ["Pizza", "Sushi"], maxSelections: 1, }); - expect(mocks.createPoll).toHaveBeenCalledWith( - expect.objectContaining({ - id: "poll-1", - question: "Snack?", - options: ["Pizza", "Sushi"], - }), - ); + const [pollRecord] = mocks.createPoll.mock.calls[0] ?? []; + expect(pollRecord).toEqual({ + id: "poll-1", + question: "Snack?", + options: ["Pizza", "Sushi"], + maxSelections: 1, + createdAt: pollRecord?.createdAt, + conversationId: "conv-1", + messageId: "msg-poll-1", + votes: {}, + }); + expect(Number.isNaN(Date.parse(pollRecord?.createdAt))).toBe(false); }); it("chunks outbound text without requiring MSTeams runtime initialization", () => {