mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 08:01:40 +00:00
test: finish readonly fixture compatibility for CI check
This commit is contained in:
committed by
Peter Steinberger
parent
c7c047287e
commit
828f4e18e0
@@ -727,7 +727,10 @@ describe("discord reaction notification gating", () => {
|
|||||||
expect(
|
expect(
|
||||||
shouldEmitDiscordReactionNotification({
|
shouldEmitDiscordReactionNotification({
|
||||||
...testCase.input,
|
...testCase.input,
|
||||||
allowlist: testCase.input.allowlist ? [...testCase.input.allowlist] : undefined,
|
allowlist:
|
||||||
|
"allowlist" in testCase.input && testCase.input.allowlist
|
||||||
|
? [...testCase.input.allowlist]
|
||||||
|
: undefined,
|
||||||
}),
|
}),
|
||||||
testCase.name,
|
testCase.name,
|
||||||
).toBe(testCase.expected);
|
).toBe(testCase.expected);
|
||||||
|
|||||||
@@ -847,9 +847,13 @@ describe("normalizeOutboundPayloadsForJson", () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const testCase of cases) {
|
for (const testCase of cases) {
|
||||||
expect(
|
const input = testCase.input.map((payload) => {
|
||||||
normalizeOutboundPayloadsForJson(testCase.input.map((payload) => ({ ...payload }))),
|
if ("mediaUrls" in payload && payload.mediaUrls) {
|
||||||
).toEqual(testCase.expected);
|
return { ...payload, mediaUrls: [...payload.mediaUrls] };
|
||||||
|
}
|
||||||
|
return { ...payload };
|
||||||
|
});
|
||||||
|
expect(normalizeOutboundPayloadsForJson(input)).toEqual(testCase.expected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -595,16 +595,20 @@ describe("sendMessageTelegram", () => {
|
|||||||
fileName: "video.mp4",
|
fileName: "video.mp4",
|
||||||
});
|
});
|
||||||
|
|
||||||
const opts = {
|
const opts: Parameters<typeof sendMessageTelegram>[2] = {
|
||||||
token: "tok",
|
token: "tok",
|
||||||
api,
|
api,
|
||||||
mediaUrl: "https://example.com/video.mp4",
|
mediaUrl: "https://example.com/video.mp4",
|
||||||
asVideoNote: true,
|
asVideoNote: true,
|
||||||
...testCase.options,
|
...("replyToMessageId" in testCase.options
|
||||||
|
? { replyToMessageId: testCase.options.replyToMessageId }
|
||||||
|
: {}),
|
||||||
|
...("buttons" in testCase.options
|
||||||
|
? {
|
||||||
|
buttons: testCase.options.buttons.map((row) => row.map((button) => ({ ...button }))),
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
};
|
};
|
||||||
if (opts.buttons) {
|
|
||||||
opts.buttons = opts.buttons.map((row) => [...row]);
|
|
||||||
}
|
|
||||||
|
|
||||||
await sendMessageTelegram(chatId, testCase.text, opts);
|
await sendMessageTelegram(chatId, testCase.text, opts);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user