loadMessages bug fix

This commit is contained in:
Adhiraj
2020-08-31 20:03:22 +05:30
parent 420c707195
commit ad922a38f6
2 changed files with 9 additions and 10 deletions

View File

@@ -116,13 +116,14 @@ WAConnectionTest('Misc', (conn) => {
assert.ok (response.messages.length >= 0)
}
})
it('should load a single message', async () => {
const {messages} = await conn.loadMessages (testJid, 10)
const {messages} = await conn.loadMessages (testJid, 25)
for (var message of messages) {
const loaded = await conn.loadMessage (testJid, message.key.id)
assert.equal (loaded.key.id, message.key.id)
await delay (1000)
}
assert.equal (loaded.key.id, message.key.id, `loaded message ${JSON.stringify(message)} incorrectly`)
await delay (500)
}
})
it('should update presence', async () => {