mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
clearMessage & update on modifyChat & support for browser credentials
This commit is contained in:
@@ -62,10 +62,14 @@ WAClientTest('Messages', (client) => {
|
||||
})
|
||||
it('should send a text message & delete it', async () => {
|
||||
const message = await sendAndRetreiveMessage(client, 'hello fren', MessageType.text)
|
||||
assert.strictEqual(message.message.conversation, 'hello fren')
|
||||
await createTimeout (2000)
|
||||
await client.deleteMessage (testJid, message.key)
|
||||
})
|
||||
it('should clear the most recent message', async () => {
|
||||
const messages = await client.loadConversation (testJid, 1)
|
||||
await createTimeout (2000)
|
||||
await client.clearMessage (messages[0].key)
|
||||
})
|
||||
})
|
||||
|
||||
describe('Validate WhatsApp IDs', () => {
|
||||
@@ -118,10 +122,9 @@ WAClientTest('Misc', (client) => {
|
||||
await client.modifyChat (testJid, ChatModification.unarchive)
|
||||
})
|
||||
it('should pin & unpin a chat', async () => {
|
||||
const pindate = new Date()
|
||||
await client.modifyChat (testJid, ChatModification.pin, {stamp: pindate})
|
||||
const response = await client.modifyChat (testJid, ChatModification.pin)
|
||||
await createTimeout (2000)
|
||||
await client.modifyChat (testJid, ChatModification.unpin, {stamp: pindate})
|
||||
await client.modifyChat (testJid, ChatModification.unpin, {stamp: response.stamp})
|
||||
})
|
||||
it('should mute & unmute a chat', async () => {
|
||||
const mutedate = new Date (new Date().getTime() + 8*60*60*1000) // 8 hours in the future
|
||||
@@ -129,9 +132,6 @@ WAClientTest('Misc', (client) => {
|
||||
await createTimeout (2000)
|
||||
await client.modifyChat (testJid, ChatModification.unmute, {stamp: mutedate})
|
||||
})
|
||||
it('should unpin a chat', async () => {
|
||||
await client.modifyChat (testJid, ChatModification.unpin)
|
||||
})
|
||||
it('should return search results', async () => {
|
||||
const response = await client.searchMessages('Adh', 25, 0)
|
||||
assert.ok (response.messages)
|
||||
|
||||
Reference in New Issue
Block a user