Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
test(session): await the history callback in the specs that call it
Yudhi Armyndharis7196c62125ee
diff --git a/src/modules/session/session.service.spec.ts b/src/modules/session/session.service.spec.tsindex 6f7bbd2d8..c53c6bb2d 100644--- a/src/modules/session/session.service.spec.ts+++ b/src/modules/session/session.service.spec.ts@@ -7265,7 +7265,7 @@ describe('SessionService', () => {(messageRepository.create as jest.Mock).mockImplementation((data: Record<string, unknown>) => ({ ...data }));(messageRepository.save as jest.Mock).mockClear();- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h1',from: '[email protected]',@@ -7303,7 +7303,7 @@ describe('SessionService', () => {return Promise.resolve([]);});- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h1',from: '[email protected]',@@ -7350,7 +7350,7 @@ describe('SessionService', () => {kind: 'group',...over,});- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([histMsg({ id: 'h-in', fromMe: false, author: '[email protected]' }),histMsg({ id: 'h-out', fromMe: true, author: '[email protected]' }),]);@@ -7379,7 +7379,7 @@ describe('SessionService', () => {(messageRepository.find as jest.Mock).mockResolvedValue([]); // nothing pre-seen(messageRepository.create as jest.Mock).mockImplementation((data: Record<string, unknown>) => ({ ...data }));- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h-img',from: '[email protected]',@@ -7422,7 +7422,7 @@ describe('SessionService', () => {const callbacks = await startAndCaptureCallbacks();const { qb, execute } = setupBulkQb();- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h-eph',from: '[email protected]',@@ -7450,7 +7450,7 @@ describe('SessionService', () => {const callbacks = await startAndCaptureCallbacks();const { qb } = setupBulkQb();- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h-eph-default',from: '[email protected]',@@ -7479,7 +7479,7 @@ describe('SessionService', () => {const callbacks = await startAndCaptureCallbacks();const { qb } = setupBulkQb();- callbacks.onHistoryMessages?.([+ await callbacks.onHistoryMessages?.([{id: 'h-normal',from: '[email protected]',