Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
test(message): read the pacing mock without an unbound method
Yudhi Armyndharisfae1650cade4
diff --git a/src/modules/message/message.service.spec.ts b/src/modules/message/message.service.spec.tsindex 0360e4970..02c95a511 100644--- a/src/modules/message/message.service.spec.ts+++ b/src/modules/message/message.service.spec.ts@@ -71,7 +71,7 @@ describe('MessageService', () => {let hookManager: jest.Mocked<Partial<HookManager>>;let lidMappingStore: { findLidsForPhone: jest.Mock; findPhoneForLid: jest.Mock };let mockEngine: ReturnType<typeof createMockEngine>;- let pacing: SendPacingService;+ let pacing: { assertSendAllowed: jest.Mock };beforeEach(async () => {repository = {@@ -859,7 +859,7 @@ describe('MessageService', () => {it('checks an edit against the pacing caps without holding it', async () => {await service.editMessage('sess-1', { chatId: '[email protected]', messageId: 'wa-msg-1', body: 'edited' });- expect(jest.mocked(pacing.assertSendAllowed)).toHaveBeenCalledWith('sess-1', '[email protected]', { hold: false });+ expect(pacing.assertSendAllowed).toHaveBeenCalledWith('sess-1', '[email protected]', { hold: false });});it('lets a plugin block an edit before the engine is called', async () => {