mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:44:33 +00:00
test: merge telegram thread id normalization assertions
This commit is contained in:
@@ -64,12 +64,6 @@ describe("buildTelegramThreadParams", () => {
|
|||||||
message_thread_id: 0,
|
message_thread_id: 0,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("normalizes thread ids to integers", () => {
|
|
||||||
expect(buildTelegramThreadParams({ id: 42.9, scope: "forum" })).toEqual({
|
|
||||||
message_thread_id: 42,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("buildTypingThreadParams", () => {
|
describe("buildTypingThreadParams", () => {
|
||||||
@@ -80,9 +74,20 @@ describe("buildTypingThreadParams", () => {
|
|||||||
it("includes General topic thread id for typing indicators", () => {
|
it("includes General topic thread id for typing indicators", () => {
|
||||||
expect(buildTypingThreadParams(1)).toEqual({ message_thread_id: 1 });
|
expect(buildTypingThreadParams(1)).toEqual({ message_thread_id: 1 });
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("normalizes thread ids to integers", () => {
|
describe("thread id normalization", () => {
|
||||||
expect(buildTypingThreadParams(42.9)).toEqual({ message_thread_id: 42 });
|
it.each([
|
||||||
|
{
|
||||||
|
build: () => buildTelegramThreadParams({ id: 42.9, scope: "forum" }),
|
||||||
|
expected: { message_thread_id: 42 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
build: () => buildTypingThreadParams(42.9),
|
||||||
|
expected: { message_thread_id: 42 },
|
||||||
|
},
|
||||||
|
])("normalizes thread ids to integers", ({ build, expected }) => {
|
||||||
|
expect(build()).toEqual(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user