test: tighten telegram approval delivery assertions

This commit is contained in:
Shakker
2026-05-11 03:44:05 +01:00
parent 7aff45e47f
commit 18878ff91e
2 changed files with 17 additions and 25 deletions

View File

@@ -100,24 +100,19 @@ describe("telegramApprovalNativeRuntime", () => {
},
});
expect(sendTyping).toHaveBeenCalledWith(
"-1003841603622",
expect.objectContaining({
token: "tg-token",
accountId: "default",
messageThreadId: 928,
}),
);
expect(sendMessage).toHaveBeenCalledWith(
"-1003841603622",
"pending",
expect.objectContaining({
token: "tg-token",
accountId: "default",
messageThreadId: 928,
buttons: [],
}),
);
expect(sendTyping).toHaveBeenCalledWith("-1003841603622", {
cfg: {},
token: "tg-token",
accountId: "default",
messageThreadId: 928,
});
expect(sendMessage).toHaveBeenCalledWith("-1003841603622", "pending", {
cfg: {},
token: "tg-token",
accountId: "default",
buttons: [],
messageThreadId: 928,
});
expect(entry).toEqual({
chatId: "-1003841603622",
messageId: "m1",

View File

@@ -8,13 +8,10 @@ describe("Telegram native quote candidates", () => {
maxLength: 10,
});
expect(candidate).toEqual(
expect.objectContaining({
text: " quoted c",
position: 0,
}),
);
expect(candidate).not.toHaveProperty("entities");
expect(candidate).toEqual({
text: " quoted c",
position: 0,
});
});
it("does not split UTF-16 surrogate pairs at the quote cap", () => {