Allow the tests to force a MatrixClient
parent
eb78b1b328
commit
19500cf96a
|
@ -101,7 +101,11 @@ export class RoomListStore2 extends AsyncStoreWithClient<ActionPayload> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public for test usage. Do not call this.
|
// Public for test usage. Do not call this.
|
||||||
public async makeReady() {
|
public async makeReady(forcedClient?: MatrixClient) {
|
||||||
|
if (forcedClient) {
|
||||||
|
super.matrixClient = forcedClient;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Remove with https://github.com/vector-im/riot-web/issues/14367
|
// TODO: Remove with https://github.com/vector-im/riot-web/issues/14367
|
||||||
this.checkEnabled();
|
this.checkEnabled();
|
||||||
if (!this.enabled) return;
|
if (!this.enabled) return;
|
||||||
|
|
|
@ -109,7 +109,7 @@ describe('RoomList', () => {
|
||||||
client.getRoom = (roomId) => roomMap[roomId];
|
client.getRoom = (roomId) => roomMap[roomId];
|
||||||
|
|
||||||
// Now that everything has been set up, prepare and update the store
|
// Now that everything has been set up, prepare and update the store
|
||||||
await RoomListStore.instance.makeReady();
|
await RoomListStore.instance.makeReady(client);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue