1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

get rid of bunch of seemingly pointless waits

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2019-12-04 23:42:16 +00:00
parent 87a8e4c216
commit bf45c176a7

View File

@@ -324,14 +324,8 @@ describe("Crypto", function() {
expect(aliceClient.sendToDevice).toBeCalledTimes(1); expect(aliceClient.sendToDevice).toBeCalledTimes(1);
const txnId = aliceClient.sendToDevice.mock.calls[0][2]; const txnId = aliceClient.sendToDevice.mock.calls[0][2];
// give the room key request manager time to update the state
// of the request
await Promise.resolve();
// cancel and resend the room key request // cancel and resend the room key request
await aliceClient.cancelAndResendEventRoomKeyRequest(event); await aliceClient.cancelAndResendEventRoomKeyRequest(event);
jest.runAllTimers();
await Promise.resolve();
// cancelAndResend will call sendToDevice twice: // cancelAndResend will call sendToDevice twice:
// the first call to sendToDevice will be the cancellation // the first call to sendToDevice will be the cancellation
// the second call to sendToDevice will be the key request // the second call to sendToDevice will be the key request