diff --git a/src/stores/ReadyWatchingStore.ts b/src/stores/ReadyWatchingStore.ts index 9a28fe75fa..4bb577c784 100644 --- a/src/stores/ReadyWatchingStore.ts +++ b/src/stores/ReadyWatchingStore.ts @@ -42,6 +42,10 @@ export abstract class ReadyWatchingStore extends EventEmitter implements IDestro return this.matrixClient; // for external readonly access } + public useUnitTestClient(cli: MatrixClient) { + this.matrixClient = cli; + } + public destroy() { this.dispatcher.unregister(this.dispatcherRef); } diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index cc9e00d29b..febd9aad9b 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -114,7 +114,7 @@ export class RoomListStoreClass extends AsyncStoreWithClient { // Public for test usage. Do not call this. public async makeReady(forcedClient?: MatrixClient) { if (forcedClient) { - super.readyStore.matrixClient = forcedClient; + super.readyStore.useUnitTestClient(forcedClient); } this.checkLoggingEnabled();