@wireapp/core 46.46.4 → 46.46.5-beta.1.0368ac746
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -454,6 +454,23 @@ describe('MLSService', () => {
|
|
|
454
454
|
jest.advanceTimersByTime(commitDelay);
|
|
455
455
|
expect(transactionContext.decryptMessage).toHaveBeenCalled();
|
|
456
456
|
});
|
|
457
|
+
it('Throws if decryption fails', async () => {
|
|
458
|
+
const [mlsService, { transactionContext }] = await createMLSService();
|
|
459
|
+
const getGroupIdFromConversationId = () => Promise.resolve(mockGroupId);
|
|
460
|
+
jest
|
|
461
|
+
.spyOn(transactionContext, 'decryptMessage')
|
|
462
|
+
.mockRejectedValueOnce(new Error(CoreCryptoMLSError_1.CORE_CRYPTO_ERROR_NAMES.MlsErrorWrongEpoch));
|
|
463
|
+
const mockedMLSMessageAddEvent = {
|
|
464
|
+
type: event_1.CONVERSATION_EVENT.MLS_MESSAGE_ADD,
|
|
465
|
+
senderClientId: '',
|
|
466
|
+
conversation: '',
|
|
467
|
+
data: mockedMLSWelcomeEventData,
|
|
468
|
+
from: '',
|
|
469
|
+
time: '',
|
|
470
|
+
};
|
|
471
|
+
await expect(mlsService.handleMLSMessageAddEvent(mockedMLSMessageAddEvent, getGroupIdFromConversationId)).rejects.toThrow(CoreCryptoMLSError_1.CORE_CRYPTO_ERROR_NAMES.MlsErrorWrongEpoch);
|
|
472
|
+
expect(transactionContext.decryptMessage).toHaveBeenCalled();
|
|
473
|
+
});
|
|
457
474
|
});
|
|
458
475
|
describe('handleMLSWelcomeMessageEvent', () => {
|
|
459
476
|
it("before processing welcome it verifies that there's enough key packages locally", async () => {
|
package/package.json
CHANGED