Set auto on-a-call status (#34306)
* Support for reading m.call status (well, the prefixed version) * Abstract the details away in userStatusFromProfile make the validate functions non-exported * Write on on-=a-call status * Add tests * Move user call status logic to its own listener * Move tests * use vi rather than jest * add more mocks * call async
This commit is contained in:
@@ -135,7 +135,7 @@ export function useMockedCalls() {
|
||||
* Enables the feature flags required for call tests.
|
||||
*/
|
||||
export function enableCalls(): { enabledSettings: Set<string> } {
|
||||
const enabledSettings = new Set(["feature_video_rooms", "feature_element_call_video_rooms"]);
|
||||
const enabledSettings = new Set(["feature_video_rooms", "feature_element_call_video_rooms", "feature_user_status"]);
|
||||
jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName): any => {
|
||||
if (settingName.startsWith("feature_")) return enabledSettings.has(settingName);
|
||||
if (settingName === "activeCallRoomIds") return [];
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
describe("CallStore", () => {
|
||||
let client: MockedObject<MatrixClient>;
|
||||
let room: Room;
|
||||
|
||||
beforeEach(() => {
|
||||
enableCalls();
|
||||
const res = setUpClientRoomAndStores();
|
||||
|
||||
Reference in New Issue
Block a user