You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Fix tests
This commit is contained in:
@ -204,7 +204,7 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
|
|||||||
CommunityPrototypeStore.getUpdateEventName(this.props.room.roomId),
|
CommunityPrototypeStore.getUpdateEventName(this.props.room.roomId),
|
||||||
this.onCommunityUpdate,
|
this.onCommunityUpdate,
|
||||||
);
|
);
|
||||||
MatrixClientPeg.get()?.off("Room.localEchoUpdated", this.onLocalEchoUpdated);
|
MatrixClientPeg.get()?.removeListener("Room.localEchoUpdated", this.onLocalEchoUpdated);
|
||||||
}
|
}
|
||||||
|
|
||||||
private onAction = (payload: ActionPayload) => {
|
private onAction = (payload: ActionPayload) => {
|
||||||
|
@ -29,7 +29,10 @@ function waitForRoomListStoreUpdate() {
|
|||||||
|
|
||||||
describe('RoomList', () => {
|
describe('RoomList', () => {
|
||||||
function createRoom(opts) {
|
function createRoom(opts) {
|
||||||
const room = new Room(generateRoomId(), null, client.getUserId());
|
const room = new Room(generateRoomId(), MatrixClientPeg.get(), client.getUserId(), {
|
||||||
|
// The room list now uses getPendingEvents(), so we need a detached ordering.
|
||||||
|
pendingEventOrdering: "detached",
|
||||||
|
});
|
||||||
if (opts) {
|
if (opts) {
|
||||||
Object.assign(room, opts);
|
Object.assign(room, opts);
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,13 @@ export function createTestClient() {
|
|||||||
generateClientSecret: () => "t35tcl1Ent5ECr3T",
|
generateClientSecret: () => "t35tcl1Ent5ECr3T",
|
||||||
isGuest: () => false,
|
isGuest: () => false,
|
||||||
isCryptoEnabled: () => false,
|
isCryptoEnabled: () => false,
|
||||||
|
|
||||||
|
// Used by various internal bits we aren't concerned with (yet)
|
||||||
|
_sessionStore: {
|
||||||
|
store: {
|
||||||
|
getItem: jest.fn(),
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user