Show & clear your own on-a-call status (#34613)
* Show & clear your own on-a-call status The user menu / settings now reflects your own on-a-call status and pressing the 'clear' button will clear both m.status and m.call, whichever are set. * Update function name * Fix tests And make the clear status function simpler by just throwing if either fails. * Fix more tests
This commit is contained in:
@@ -32,6 +32,7 @@ describe("UserMenuViewModel", () => {
|
||||
...mockClientMethodsUser(),
|
||||
...mockClientMethodsServer(),
|
||||
getAuthMetadata: jest.fn().mockRejectedValue(new MatrixError({ errcode: "M_UNRECOGNIZED" }, 404)),
|
||||
getExtendedProfileProperty: jest.fn().mockResolvedValue(undefined),
|
||||
setExtendedProfileProperty: jest.fn().mockResolvedValue(undefined),
|
||||
});
|
||||
sdkContext = new TestSDKContext();
|
||||
@@ -178,6 +179,7 @@ describe("UserMenuViewModel", () => {
|
||||
});
|
||||
|
||||
it("can clear a user status", async () => {
|
||||
client.getExtendedProfileProperty.mockResolvedValue({ emoji: "🧪", text: "Testing" });
|
||||
const vm = new UserMenuViewModel({ ownProfileStore: mockOwnProfileStore }, dispatcher, client, true);
|
||||
vm.setOpen(true);
|
||||
vm.clearStatus();
|
||||
|
||||
Reference in New Issue
Block a user