mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 09:00:22 +00:00
test: merge telegram thread id normalization assertions
This commit is contained in:
@@ -64,12 +64,6 @@ describe("buildTelegramThreadParams", () => {
|
||||
message_thread_id: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it("normalizes thread ids to integers", () => {
|
||||
expect(buildTelegramThreadParams({ id: 42.9, scope: "forum" })).toEqual({
|
||||
message_thread_id: 42,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildTypingThreadParams", () => {
|
||||
@@ -80,9 +74,20 @@ describe("buildTypingThreadParams", () => {
|
||||
it("includes General topic thread id for typing indicators", () => {
|
||||
expect(buildTypingThreadParams(1)).toEqual({ message_thread_id: 1 });
|
||||
});
|
||||
});
|
||||
|
||||
it("normalizes thread ids to integers", () => {
|
||||
expect(buildTypingThreadParams(42.9)).toEqual({ message_thread_id: 42 });
|
||||
describe("thread id normalization", () => {
|
||||
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