You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Video call meta space (#12297)
* add video room meta space button Signed-off-by: Timo K <toger5@hotmail.de> * Add videoRoomsSpace to meta space configuration Signed-off-by: Timo K <toger5@hotmail.de> * temp Signed-off-by: Timo K <toger5@hotmail.de> * dont show ppl section in video room space Signed-off-by: Timo K <toger5@hotmail.de> * add i18n strings Signed-off-by: Timo K <toger5@hotmail.de> * revert waitForIframe=false (this is part of another PR) Signed-off-by: Timo K <toger5@hotmail.de> * fix missing mock room method Signed-off-by: Timo K <toger5@hotmail.de> * test snapshot: add video room meta space Signed-off-by: Timo K <toger5@hotmail.de> * rename Conferences -> Conference Signed-off-by: Timo K <toger5@hotmail.de> * space panel snap test Signed-off-by: Timo K <toger5@hotmail.de> * update snapshot Signed-off-by: Timo K <toger5@hotmail.de> * fix test Signed-off-by: Timo K <toger5@hotmail.de> * add video room space tests Signed-off-by: Timo K <toger5@hotmail.de> * better logic Signed-off-by: Timo K <toger5@hotmail.de> * Add Video MetaSpace Test Signed-off-by: Timo K <toger5@hotmail.de> * make room join rule update reactive for the video room meta space Signed-off-by: Timo K <toger5@hotmail.de> * temp Signed-off-by: Timo K <toger5@hotmail.de> * fix description for meta space video room settings Signed-off-by: Timo K <toger5@hotmail.de> * tests Signed-off-by: Timo K <toger5@hotmail.de> * update snapshot Signed-off-by: Timo K <toger5@hotmail.de> * review Signed-off-by: Timo K <toger5@hotmail.de> * i18n Signed-off-by: Timo K <toger5@hotmail.de> * fix tests Signed-off-by: Timo K <toger5@hotmail.de> * put video meta space behind "feature_video_rooms" labs flag Signed-off-by: Timo K <toger5@hotmail.de> * review Signed-off-by: Timo K <toger5@hotmail.de> * update space store on RoomCreate state event Signed-off-by: Timo K <toger5@hotmail.de> * test for updating video room space on room type update Signed-off-by: Timo K <toger5@hotmail.de> * remove comment Signed-off-by: Timo K <toger5@hotmail.de> * also make knock join rule rooms part of the conference section Signed-off-by: Timo K <toger5@hotmail.de> --------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -15,11 +15,10 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { render, screen, fireEvent, act } from "@testing-library/react";
|
||||
import { render, screen, fireEvent, act, cleanup } from "@testing-library/react";
|
||||
import { mocked } from "jest-mock";
|
||||
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import UnwrappedSpacePanel from "../../../../src/components/views/spaces/SpacePanel";
|
||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||
import { MetaSpace, SpaceKey } from "../../../../src/stores/spaces";
|
||||
import { shouldShowComponent } from "../../../../src/customisations/helpers/UIComponents";
|
||||
@@ -29,6 +28,8 @@ import { SdkContextClass } from "../../../../src/contexts/SDKContext";
|
||||
import SpaceStore from "../../../../src/stores/spaces/SpaceStore";
|
||||
import DMRoomMap from "../../../../src/utils/DMRoomMap";
|
||||
import { SpaceNotificationState } from "../../../../src/stores/notifications/SpaceNotificationState";
|
||||
import SettingsStore from "../../../../src/settings/SettingsStore";
|
||||
import UnwrappedSpacePanel from "../../../../src/components/views/spaces/SpacePanel";
|
||||
|
||||
// DND test utilities based on
|
||||
// https://github.com/colinrobertbrooks/react-beautiful-dnd-test-utils/issues/18#issuecomment-1373388693
|
||||
@@ -135,8 +136,28 @@ describe("<SpacePanel />", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
SpaceStore.instance.enabledMetaSpaces.push(
|
||||
MetaSpace.Home,
|
||||
MetaSpace.Favourites,
|
||||
MetaSpace.People,
|
||||
MetaSpace.Orphans,
|
||||
MetaSpace.VideoRooms,
|
||||
);
|
||||
mocked(shouldShowComponent).mockClear().mockReturnValue(true);
|
||||
});
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it("should show all activated MetaSpaces in the correct order", async () => {
|
||||
const originalGetValue = SettingsStore.getValue;
|
||||
const spySettingsStore = jest.spyOn(SettingsStore, "getValue").mockImplementation((setting) => {
|
||||
return setting === "feature_video_rooms" ? true : originalGetValue(setting);
|
||||
});
|
||||
const renderResult = render(<SpacePanel />);
|
||||
expect(renderResult.asFragment()).toMatchSnapshot();
|
||||
spySettingsStore.mockRestore();
|
||||
});
|
||||
|
||||
describe("create new space button", () => {
|
||||
it("renders create space button when UIComponent.CreateSpaces component should be shown", () => {
|
||||
|
Reference in New Issue
Block a user