diff --git a/packages/core/src/agent/__tests__/MessageSender.test.ts b/packages/core/src/agent/__tests__/MessageSender.test.ts index cc5ac7fbd1..35d566c3b0 100644 --- a/packages/core/src/agent/__tests__/MessageSender.test.ts +++ b/packages/core/src/agent/__tests__/MessageSender.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import type { ConnectionRecord } from '../../modules/connections' import type { ResolvedDidCommService } from '../../modules/didcomm' import type { DidDocumentService } from '../../modules/dids' @@ -365,10 +366,12 @@ describe('MessageSender', () => { test('call send message on session when there is a session for a given connection', async () => { messageSender.registerOutboundTransport(outboundTransport) const sendMessageSpy = jest.spyOn(outboundTransport, 'sendMessage') + //@ts-ignore const sendToServiceSpy = jest.spyOn(messageSender, 'sendToService') await messageSender.sendMessage(outboundMessageContext) + //@ts-ignore const [[sendMessage]] = sendToServiceSpy.mock.calls expect(eventListenerMock).toHaveBeenCalledWith({ @@ -394,9 +397,12 @@ describe('MessageSender', () => { }, }) + //@ts-ignore expect(sendMessage.serviceParams.senderKey.publicKeyBase58).toEqual( 'EoGusetSxDJktp493VCyh981nUnzMamTRjvBaHZAy68d' ) + + //@ts-ignore expect(sendMessage.serviceParams.service.recipientKeys.map((key) => key.publicKeyBase58)).toEqual([ 'EoGusetSxDJktp493VCyh981nUnzMamTRjvBaHZAy68d', ]) @@ -427,6 +433,7 @@ describe('MessageSender', () => { }, }) + //@ts-ignore const [, [sendMessage]] = sendToServiceSpy.mock.calls expect(sendMessage).toMatchObject({ @@ -443,9 +450,11 @@ describe('MessageSender', () => { }, }) + //@ts-ignore expect(sendMessage.serviceParams.senderKey.publicKeyBase58).toEqual( 'EoGusetSxDJktp493VCyh981nUnzMamTRjvBaHZAy68d' ) + //@ts-ignore expect(sendMessage.serviceParams.service.recipientKeys.map((key) => key.publicKeyBase58)).toEqual([ 'EoGusetSxDJktp493VCyh981nUnzMamTRjvBaHZAy68d', ]) diff --git a/packages/core/src/modules/routing/services/__tests__/V2MessagePickupService.test.ts b/packages/core/src/modules/routing/services/__tests__/V2MessagePickupService.test.ts index f5fd94a34a..53012f73b0 100644 --- a/packages/core/src/modules/routing/services/__tests__/V2MessagePickupService.test.ts +++ b/packages/core/src/modules/routing/services/__tests__/V2MessagePickupService.test.ts @@ -70,7 +70,7 @@ describe('V2MessagePickupService', () => { messageCount: 0, }) ) - expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(connection.id) + expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(mockConnection.id) }) test('multiple messages in queue', async () => { @@ -89,7 +89,7 @@ describe('V2MessagePickupService', () => { messageCount: 5, }) ) - expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(connection.id) + expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(mockConnection.id) }) test('status request specifying recipient key', async () => { @@ -125,7 +125,7 @@ describe('V2MessagePickupService', () => { messageCount: 0, }) ) - expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(connection.id, 10, true) + expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(mockConnection.id, 10, true) }) test('less messages in queue than limit', async () => { @@ -152,7 +152,7 @@ describe('V2MessagePickupService', () => { ) ) ) - expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(connection.id, 10, true) + expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(mockConnection.id, 10, true) }) test('more messages in queue than limit', async () => { @@ -179,7 +179,7 @@ describe('V2MessagePickupService', () => { ) ) ) - expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(connection.id, 2, true) + expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(mockConnection.id, 2, true) }) test('delivery request specifying recipient key', async () => { @@ -219,8 +219,8 @@ describe('V2MessagePickupService', () => { messageCount: 4, }) ) - expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(connection.id) - expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(connection.id, 2) + expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(mockConnection.id) + expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(mockConnection.id, 2) }) test('all messages have been received', async () => { @@ -244,8 +244,8 @@ describe('V2MessagePickupService', () => { }) ) - expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(connection.id) - expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(connection.id, 2) + expect(messageRepository.getAvailableMessageCount).toHaveBeenCalledWith(mockConnection.id) + expect(messageRepository.takeFromQueue).toHaveBeenCalledWith(mockConnection.id, 2) }) }) })