sdk: fix test

This commit is contained in:
Evgeny Poberezkin 2024-10-10 19:15:09 +01:00
parent 75bacb7923
commit ec014d721e
No known key found for this signature in database
GPG key ID: 494BDDD9A28B577D

View file

@ -26,8 +26,8 @@ describe.skip("ChatClient (expects SimpleX Chat server with a user, without cont
assert(r2.type === "contactConnected")
const contact1 = (r1 as CR.CRContactConnected).contact
// const contact2 = (r2 as C.CRContactConnected).contact
const r3 = await c.apiSendTextMessage(CC.ChatType.CTDirect, contact1.contactId, "hello")
assert(r3.chatItem.content.type === "sndMsgContent" && r3.chatItem.content.msgContent.text === "hello")
const r3 = await c.apiSendTextMessage(CC.ChatType.Direct, contact1.contactId, "hello")
assert(r3[0].chatItem.content.type === "sndMsgContent" && r3[0].chatItem.content.msgContent.text === "hello")
const r4 = await c.msgQ.dequeue()
assert(isItemSent(r4) || isNewRcvItem(r4))
await c.disconnect()
@ -38,9 +38,9 @@ describe.skip("ChatClient (expects SimpleX Chat server with a user, without cont
function isNewRcvItem(r: CR.ChatResponse): boolean {
return (
r.type === "newChatItem" &&
r.chatItem.chatItem.content.type === "rcvMsgContent" &&
r.chatItem.chatItem.content.msgContent.text === "hello"
r.type === "newChatItems" &&
r.chatItems[0].chatItem.content.type === "rcvMsgContent" &&
r.chatItems[0].chatItem.content.msgContent.text === "hello"
)
}
}, 20000)