Skip to content

Commit 6bfb5ed

Browse files
committed
test(slack): assert private card metadata with direct JSON serialization
1 parent 666d454 commit 6bfb5ed

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎extensions/slack/src/send.blocks.test.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ describe("sendMessageSlack blocks", () => {
404404
{ type: "section", text: { type: "mrkdwn", text: "Private displayed question" } },
405405
]);
406406
expect(Object.keys(result.meta ?? {})).toEqual(["slackQuestionActionIds"]);
407-
expect(JSON.parse(JSON.stringify(result.meta))).toEqual({
408-
slackQuestionActionIds: [questionActionId],
409-
});
407+
expect(JSON.stringify(result.meta)).toBe(
408+
JSON.stringify({ slackQuestionActionIds: [questionActionId] }),
409+
);
410410
expect(onDeliveryResult).toHaveBeenCalledWith(
411411
expect.objectContaining({
412412
messageId: "171234.567",
@@ -452,10 +452,12 @@ describe("sendMessageSlack blocks", () => {
452452
).toBe(true);
453453
const questionDelivery = delivered.find((delivery) => delivery.meta);
454454
expect(questionDelivery?.messageId).not.toBe(aggregateResult.messageId);
455-
expect(JSON.parse(JSON.stringify(aggregateResult.meta))).toEqual({
456-
slackQuestionActionIds: [questionActionId],
457-
slackQuestionMessageId: questionDelivery?.messageId,
458-
});
455+
expect(JSON.stringify(aggregateResult.meta)).toBe(
456+
JSON.stringify({
457+
slackQuestionActionIds: [questionActionId],
458+
slackQuestionMessageId: questionDelivery?.messageId,
459+
}),
460+
);
459461
expect(aggregateResult.meta?.[SLACK_QUESTION_FINALIZATION_BLOCKS]).toBe(
460462
questionDelivery?.meta?.[SLACK_QUESTION_FINALIZATION_BLOCKS],
461463
);

0 commit comments

Comments
 (0)