Skip to content

Commit

Permalink
test: check if message was injected
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX committed Jan 19, 2024
1 parent 796a633 commit fdfec43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/script/conversation/ConversationRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ describe('ConversationRepository', () => {
.mockReturnValueOnce(proteus1to1Conversation);
jest.spyOn(conversationRepository['conversationService'], 'deleteConversationFromDb');
jest.spyOn(conversationRepository['conversationService'], 'blacklistConversation');
jest.spyOn(conversationRepository['eventRepository'], 'injectEvent').mockResolvedValueOnce(undefined);

const conversationEntity = await conversationRepository.getInitialised1To1Conversation(otherUser);

Expand All @@ -560,6 +561,7 @@ describe('ConversationRepository', () => {
proteus1to1Conversation.qualifiedId,
);
expect(container.resolve(Core).service!.conversation.establishMLS1to1Conversation).toHaveBeenCalled();
expect(conversationRepository['eventRepository'].injectEvent).toHaveBeenCalled();
expect(conversationRepository['conversationState'].conversations()).not.toEqual(
expect.arrayContaining([proteus1to1Conversation]),
);
Expand Down

0 comments on commit fdfec43

Please sign in to comment.