test: tighten telegram dm pairing assertions

This commit is contained in:
Shakker
2026-05-11 03:42:53 +01:00
parent 4dac591fcf
commit 7aff45e47f

View File

@@ -158,13 +158,15 @@ describe("enforceTelegramDmAccess", () => {
expect(firstCall?.[0]).toBe(42);
const sentText = typeof firstCall?.[1] === "string" ? firstCall[1] : "";
expect(sentText).toContain("Pairing code:");
expect(firstCall?.[2]).toEqual(expect.objectContaining({ parse_mode: "HTML" }));
expect(firstCall?.[2]).toEqual({ parse_mode: "HTML" });
expect(logger.info).toHaveBeenCalledWith(
expect.objectContaining({
{
chatId: "42",
senderUserId: "12345",
username: "tester",
}),
firstName: "Test",
lastName: undefined,
},
"telegram pairing request",
);
});