fix tests

This commit is contained in:
Bruno Windels 2023-03-30 14:45:59 +02:00
parent c2b6c44a68
commit ab65745b07

View File

@ -128,7 +128,6 @@ import {SendDoneStage} from "./stages/SendDoneStage";
import {SendAcceptVerificationStage} from "./stages/SendAcceptVerificationStage";
export function tests() {
async function createSASRequest(
ourUserId: string,
ourDeviceId: string,
@ -190,6 +189,7 @@ export function tests() {
olm,
startingMessage,
);
const crossSigning = new MockCrossSigning() as unknown as CrossSigning;
const clock = new MockClock();
const logger = new NullLogger();
return logger.run("log", (log) => {
@ -207,6 +207,7 @@ export function tests() {
ourUserId,
ourUserDeviceId: ourDeviceId,
log,
crossSigning
});
// @ts-ignore
channel.setOlmSas(sas.olmSas);
@ -217,6 +218,16 @@ export function tests() {
});
}
class MockCrossSigning {
signDevice(deviceId: string, log: ILogItem) {
return Promise.resolve({}); // device keys, means signing succeeded
}
signUser(userId: string, log: ILogItem) {
return Promise.resolve({}); // cross-signing keys, means signing succeeded
}
}
return {
"Order of stages created matches expected order when I sent request, they sent start": async (assert) => {
const ourDeviceId = "ILQHOACESQ";