fix tests by including client field on the Room stub and stubbing getJoinedMemberCount
This commit is contained in:
parent
9d8acd1af0
commit
04c923bd75
2 changed files with 29 additions and 27 deletions
|
@ -220,7 +220,7 @@ export function mkMessage(opts) {
|
|||
return mkEvent(opts);
|
||||
}
|
||||
|
||||
export function mkStubRoom(roomId = null, name) {
|
||||
export function mkStubRoom(roomId = null, name, client) {
|
||||
const stubTimeline = { getEvents: () => [] };
|
||||
return {
|
||||
roomId,
|
||||
|
@ -235,6 +235,7 @@ export function mkStubRoom(roomId = null, name) {
|
|||
}),
|
||||
getMembersWithMembership: jest.fn().mockReturnValue([]),
|
||||
getJoinedMembers: jest.fn().mockReturnValue([]),
|
||||
getJoinedMemberCount: jest.fn().mockReturnValue(1),
|
||||
getMembers: jest.fn().mockReturnValue([]),
|
||||
getPendingEvents: () => [],
|
||||
getLiveTimeline: () => stubTimeline,
|
||||
|
@ -270,6 +271,7 @@ export function mkStubRoom(roomId = null, name) {
|
|||
getAltAliases: jest.fn().mockReturnValue([]),
|
||||
timeline: [],
|
||||
getJoinRule: jest.fn().mockReturnValue("invite"),
|
||||
client,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue