mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
sdk: fix test
This commit is contained in:
parent
75bacb7923
commit
ec014d721e
1 changed files with 5 additions and 5 deletions
|
@ -26,8 +26,8 @@ describe.skip("ChatClient (expects SimpleX Chat server with a user, without cont
|
||||||
assert(r2.type === "contactConnected")
|
assert(r2.type === "contactConnected")
|
||||||
const contact1 = (r1 as CR.CRContactConnected).contact
|
const contact1 = (r1 as CR.CRContactConnected).contact
|
||||||
// const contact2 = (r2 as C.CRContactConnected).contact
|
// const contact2 = (r2 as C.CRContactConnected).contact
|
||||||
const r3 = await c.apiSendTextMessage(CC.ChatType.CTDirect, contact1.contactId, "hello")
|
const r3 = await c.apiSendTextMessage(CC.ChatType.Direct, contact1.contactId, "hello")
|
||||||
assert(r3.chatItem.content.type === "sndMsgContent" && r3.chatItem.content.msgContent.text === "hello")
|
assert(r3[0].chatItem.content.type === "sndMsgContent" && r3[0].chatItem.content.msgContent.text === "hello")
|
||||||
const r4 = await c.msgQ.dequeue()
|
const r4 = await c.msgQ.dequeue()
|
||||||
assert(isItemSent(r4) || isNewRcvItem(r4))
|
assert(isItemSent(r4) || isNewRcvItem(r4))
|
||||||
await c.disconnect()
|
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 {
|
function isNewRcvItem(r: CR.ChatResponse): boolean {
|
||||||
return (
|
return (
|
||||||
r.type === "newChatItem" &&
|
r.type === "newChatItems" &&
|
||||||
r.chatItem.chatItem.content.type === "rcvMsgContent" &&
|
r.chatItems[0].chatItem.content.type === "rcvMsgContent" &&
|
||||||
r.chatItem.chatItem.content.msgContent.text === "hello"
|
r.chatItems[0].chatItem.content.msgContent.text === "hello"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, 20000)
|
}, 20000)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue