From 8385100a0c710252a9338f66436ad37ce228ff2f Mon Sep 17 00:00:00 2001 From: Clairton Rodrigo Heinzen Date: Sat, 5 Oct 2024 15:36:05 -0300 Subject: [PATCH] fix test --- __tests__/services/client_baileys.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/__tests__/services/client_baileys.ts b/__tests__/services/client_baileys.ts index 490961a5..a0ee0b1e 100644 --- a/__tests__/services/client_baileys.ts +++ b/__tests__/services/client_baileys.ts @@ -16,6 +16,7 @@ import { fetchGroupMetadata, exists, close, + logout, } from '../../src/services/socket' import { mock, mockFn } from 'jest-mock-extended' import { proto } from '@whiskeysockets/baileys' @@ -44,6 +45,7 @@ describe('service client baileys', () => { let dataStore: DataStore let send let read + let logout let exists let rejectCall let fetchImageUrl @@ -77,9 +79,10 @@ describe('service client baileys', () => { read = mockFn().mockResolvedValue(true) exists = mockFn() rejectCall = mockFn() + logout = mockFn() fetchImageUrl = mockFn() fetchGroupMetadata = mockFn() - mockConnect.mockResolvedValue({ event, status, send, read, rejectCall, fetchImageUrl, fetchGroupMetadata, exists, close }) + mockConnect.mockResolvedValue({ event, status, send, read, rejectCall, fetchImageUrl, fetchGroupMetadata, exists, close, logout }) }) test('call send with unknown status', async () => { @@ -133,7 +136,7 @@ describe('service client baileys', () => { send = async () => { throw new SendError(1, '') } - mockConnect.mockResolvedValue({ event, status, send, read, rejectCall, fetchImageUrl, fetchGroupMetadata, exists, close }) + mockConnect.mockResolvedValue({ event, status, send, read, rejectCall, fetchImageUrl, fetchGroupMetadata, exists, close, logout }) await client.connect(0) const response = await client.send(payload, {}) expect(response.error.entry.length).toBe(1)