Allow joining calls and video rooms without enabling the labs flags (#95)

Since Element Call has now reached production on Element X, Element Web needs to be able to at least participate in group calls. Starting a group call or creating a video room will still require the labs flags, for now.

Note that Jitsi-based video rooms are also affected by this change. This is not because we intend to delabs them (rather, we intend to get rid of them in favor of Element Call video rooms), but because it's easiest to handle both video room variants consistently.
This commit is contained in:
Robin 2024-09-30 10:07:53 -04:00 committed by GitHub
parent 4f391645e7
commit bd793a0970
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 74 additions and 193 deletions

View file

@ -423,15 +423,7 @@ describe("Notifier", () => {
return callEvent;
};
const setGroupCallsEnabled = (val: boolean) => {
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string) => {
if (name === "feature_group_calls") return val;
});
};
it("should show toast when group calls are supported", () => {
setGroupCallsEnabled(true);
it("shows group call toast", () => {
const notifyEvent = emitCallNotifyEvent();
expect(ToastStore.sharedInstance().addOrReplaceToast).toHaveBeenCalledWith(
@ -445,16 +437,7 @@ describe("Notifier", () => {
);
});
it("should not show toast when group calls are not supported", () => {
setGroupCallsEnabled(false);
emitCallNotifyEvent();
expect(ToastStore.sharedInstance().addOrReplaceToast).not.toHaveBeenCalled();
});
it("should not show toast when group call is already connected", () => {
setGroupCallsEnabled(true);
const spyCallMemberships = jest.spyOn(MatrixRTCSession, "callMembershipsForRoom").mockReturnValue([
new CallMembership(
mkEvent({
@ -483,8 +466,6 @@ describe("Notifier", () => {
});
it("should not show toast when calling with non-group call event", () => {
setGroupCallsEnabled(true);
emitCallNotifyEvent("event_type");
expect(ToastStore.sharedInstance().addOrReplaceToast).not.toHaveBeenCalled();

View file

@ -1039,10 +1039,13 @@ describe("<MatrixChat />", () => {
});
describe("when encryption is force disabled", () => {
const unencryptedRoom = new Room("!unencrypted:server.org", loginClient, userId);
const encryptedRoom = new Room("!encrypted:server.org", loginClient, userId);
let unencryptedRoom: Room;
let encryptedRoom: Room;
beforeEach(() => {
unencryptedRoom = new Room("!unencrypted:server.org", loginClient, userId);
encryptedRoom = new Room("!encrypted:server.org", loginClient, userId);
loginClient.getClientWellKnown.mockReturnValue({
"io.element.e2ee": {
force_disable: true,

View file

@ -83,21 +83,4 @@ describe("RoomPreviewCard", () => {
await renderPreview();
expect(screen.queryByRole("button", { name: /beta/i })).toBeNull();
});
it("shows instructions on Jitsi video rooms invites if video rooms are disabled", async () => {
jest.spyOn(room, "getType").mockReturnValue(RoomType.ElementVideo);
jest.spyOn(room, "getMyMembership").mockReturnValue(KnownMembership.Invite);
await renderPreview();
screen.getByText(/enable video rooms in labs/i);
});
it("shows instructions on Element video rooms invites if video rooms are disabled", async () => {
jest.spyOn(room, "getType").mockReturnValue(RoomType.UnstableCall);
jest.spyOn(room, "getMyMembership").mockReturnValue(KnownMembership.Invite);
enabledFeatures = ["feature_element_call_video_rooms"];
await renderPreview();
screen.getByText(/enable video rooms in labs/i);
});
});