You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2026-01-03 23:22:30 +03:00
Fix broken crypto test
Now that sync takes a bit longer to send out Event events, the encrypted events have already been decrypted by the time the test sees them - so we no longer need to await their decryption.
This commit is contained in:
@@ -595,19 +595,9 @@ describe("MatrixClient crypto", function() {
|
||||
|
||||
expect(event.isEncrypted()).toBeTruthy();
|
||||
|
||||
// it will still be encrypted at first - wait for it to be decrypted.
|
||||
expect(event.getType()).toEqual("m.room.encrypted");
|
||||
expect(event.isBeingDecrypted()).toBe(true);
|
||||
|
||||
console.log(
|
||||
`bob waiting for event to be decrypted`,
|
||||
);
|
||||
event.once('Event.decrypted', (ev) => {
|
||||
expect(ev).toBe(event);
|
||||
expect(event.getType()).toEqual("m.room.message");
|
||||
expect(event.getContent().msgtype).toEqual("m.bad.encrypted");
|
||||
deferred.resolve();
|
||||
});
|
||||
expect(event.getType()).toEqual("m.room.message");
|
||||
expect(event.getContent().msgtype).toEqual("m.bad.encrypted");
|
||||
deferred.resolve();
|
||||
};
|
||||
|
||||
bobTestClient.client.once("event", onEvent);
|
||||
|
||||
Reference in New Issue
Block a user