mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
test: tighten channel send assertions
This commit is contained in:
@@ -67,35 +67,35 @@ describe("sendWebhookMessageDiscord activity", () => {
|
||||
threadId: "thread-1",
|
||||
});
|
||||
|
||||
expect(result).toMatchObject({
|
||||
expect(result).toEqual({
|
||||
messageId: "msg-1",
|
||||
channelId: "thread-1",
|
||||
});
|
||||
expect(result.receipt).toEqual({
|
||||
primaryPlatformMessageId: "msg-1",
|
||||
platformMessageIds: ["msg-1"],
|
||||
parts: [
|
||||
{
|
||||
platformMessageId: "msg-1",
|
||||
kind: "text",
|
||||
index: 0,
|
||||
threadId: "thread-1",
|
||||
raw: {
|
||||
receipt: {
|
||||
primaryPlatformMessageId: "msg-1",
|
||||
platformMessageIds: ["msg-1"],
|
||||
parts: [
|
||||
{
|
||||
platformMessageId: "msg-1",
|
||||
kind: "text",
|
||||
index: 0,
|
||||
threadId: "thread-1",
|
||||
raw: {
|
||||
channel: "discord",
|
||||
messageId: "msg-1",
|
||||
channelId: "thread-1",
|
||||
},
|
||||
},
|
||||
],
|
||||
threadId: "thread-1",
|
||||
sentAt: 1_700_000_000_000,
|
||||
raw: [
|
||||
{
|
||||
channel: "discord",
|
||||
messageId: "msg-1",
|
||||
channelId: "thread-1",
|
||||
},
|
||||
},
|
||||
],
|
||||
threadId: "thread-1",
|
||||
sentAt: 1_700_000_000_000,
|
||||
raw: [
|
||||
{
|
||||
channel: "discord",
|
||||
messageId: "msg-1",
|
||||
channelId: "thread-1",
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
});
|
||||
expect(recordChannelActivityMock).toHaveBeenCalledWith({
|
||||
channel: "discord",
|
||||
|
||||
@@ -12,7 +12,9 @@ describe("voice receive recovery", () => {
|
||||
analyzeVoiceReceiveError(
|
||||
new Error("Failed to decrypt: DecryptionFailed(UnencryptedWhenPassthroughDisabled)"),
|
||||
),
|
||||
).toMatchObject({
|
||||
).toEqual({
|
||||
message: "Failed to decrypt: DecryptionFailed(UnencryptedWhenPassthroughDisabled)",
|
||||
isAbortLike: false,
|
||||
shouldAttemptPassthrough: true,
|
||||
countsAsDecryptFailure: true,
|
||||
});
|
||||
|
||||
@@ -104,13 +104,15 @@ describe("send", () => {
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
expect(result.messageId).toBe("twitch-msg-123");
|
||||
expect(result.receipt).toMatchObject({
|
||||
expect(typeof result.receipt.sentAt).toBe("number");
|
||||
expect({ ...result.receipt, sentAt: 0 }).toEqual({
|
||||
primaryPlatformMessageId: "twitch-msg-123",
|
||||
platformMessageIds: ["twitch-msg-123"],
|
||||
parts: [
|
||||
{
|
||||
platformMessageId: "twitch-msg-123",
|
||||
kind: "text",
|
||||
index: 0,
|
||||
raw: {
|
||||
channel: "twitch",
|
||||
conversationId: "testchannel",
|
||||
@@ -118,6 +120,14 @@ describe("send", () => {
|
||||
},
|
||||
},
|
||||
],
|
||||
raw: [
|
||||
{
|
||||
channel: "twitch",
|
||||
conversationId: "testchannel",
|
||||
messageId: "twitch-msg-123",
|
||||
},
|
||||
],
|
||||
sentAt: 0,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user