Improve coverage
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
351774d3e3
commit
2099aaa663
3 changed files with 139 additions and 6 deletions
|
@ -75,6 +75,7 @@ import { ViewRoomErrorPayload } from "../../../../src/dispatcher/payloads/ViewRo
|
|||
import { SearchScope } from "../../../../src/Searching";
|
||||
import { MEGOLM_ENCRYPTION_ALGORITHM } from "../../../../src/utils/crypto";
|
||||
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";
|
||||
import { ViewUserPayload } from "../../../../src/dispatcher/payloads/ViewUserPayload.ts";
|
||||
|
||||
describe("RoomView", () => {
|
||||
let cli: MockedObject<MatrixClient>;
|
||||
|
@ -202,6 +203,21 @@ describe("RoomView", () => {
|
|||
return ref.current!;
|
||||
};
|
||||
|
||||
it("should show member list right panel phase on Action.ViewUser without `payload.member`", async () => {
|
||||
const spy = jest.spyOn(stores.rightPanelStore, "showOrHidePhase");
|
||||
await renderRoomView(false);
|
||||
|
||||
defaultDispatcher.dispatch<ViewUserPayload>(
|
||||
{
|
||||
action: Action.ViewUser,
|
||||
member: undefined,
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
expect(spy).toHaveBeenCalledWith(RightPanelPhases.MemberList);
|
||||
});
|
||||
|
||||
it("when there is no room predecessor, getHiddenHighlightCount should return 0", async () => {
|
||||
const instance = await getRoomViewInstance();
|
||||
expect(instance.getHiddenHighlightCount()).toBe(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue