tests update

This commit is contained in:
Adhiraj
2020-08-28 23:19:40 +05:30
parent 828be7f240
commit 6311303773
4 changed files with 10 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ describe('Test Connect', () => {
const conn = new WAConnection()
await conn.connect ()
assert.ok(conn.user?.id)
assert.ok(conn.user?.jid)
assert.ok(conn.user?.phone)
assert.ok (conn.user?.imgUrl || conn.user.imgUrl === '')
@@ -47,7 +47,7 @@ describe('Test Connect', () => {
.connect ({timeoutMs: 20*1000})
.then (conn => {
assert.ok(conn.user)
assert.ok(conn.user.id)
assert.ok(conn.user.jid)
const chatArray = conn.chats.all()
if (chatArray.length > 0) {
@@ -57,10 +57,6 @@ describe('Test Connect', () => {
assert.ok(chatArray[0].messages[0])
}
}
const contactValues = Object.values(conn.contacts)
if (contactValues[0]) {
assert.ok(contactValues[0].jid)
}
})
.then (() => conn.logout())
.then (() => conn.loadAuthInfo(auth))
@@ -162,7 +158,7 @@ describe ('Pending Requests', () => {
conn.close ()
const task: Promise<any> = conn.query({json: ['query', 'Status', conn.user.id]})
const task: Promise<any> = conn.query({json: ['query', 'Status', conn.user.jid]})
await delay (2000)