diff --git a/src/components/structures/MyGroups.js b/src/components/structures/MyGroups.js index cebbe30e0a..2239325f1b 100644 --- a/src/components/structures/MyGroups.js +++ b/src/components/structures/MyGroups.js @@ -25,7 +25,6 @@ import AccessibleButton from '../views/elements/AccessibleButton'; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { replaceableComponent } from "../../utils/replaceableComponent"; -import BetaCard from "../views/beta/BetaCard"; @replaceableComponent("structures.MyGroups") export default class MyGroups extends React.Component { diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 6d980d30cd..9d4592e5d7 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -16,9 +16,9 @@ limitations under the License. */ import { MatrixClient } from 'matrix-js-sdk/src/client'; -import React, { ReactNode } from "react"; +import { ReactNode } from "react"; -import { _t, _td } from '../languageHandler'; +import { _td } from '../languageHandler'; import { NotificationBodyEnabledController, NotificationsEnabledController, @@ -40,7 +40,6 @@ import { OrderedMultiController } from "./controllers/OrderedMultiController"; import { Layout } from "./Layout"; import ReducedMotionController from './controllers/ReducedMotionController'; import IncompatibleController from "./controllers/IncompatibleController"; -import SdkConfig from "../SdkConfig"; import PseudonymousAnalyticsController from './controllers/PseudonymousAnalyticsController'; import NewLayoutSwitcherController from './controllers/NewLayoutSwitcherController'; diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index cee0fe5a47..76cb6c85f3 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -20,12 +20,6 @@ function generateRoomId() { return '!' + Math.random().toString().slice(2, 10) + ':domain'; } -function waitForRoomListStoreUpdate() { - return new Promise((resolve) => { - RoomListStore.instance.once(LISTS_UPDATE_EVENT, () => resolve()); - }); -} - describe('RoomList', () => { function createRoom(opts) { const room = new Room(generateRoomId(), MatrixClientPeg.get(), client.getUserId(), { @@ -239,73 +233,6 @@ describe('RoomList', () => { }); } - describe('when no tags are selected', () => { - itDoesCorrectOptimisticUpdatesForDraggedRoomTiles(); - }); - - describe('when tags are selected', () => { - function setupSelectedTag() { - // Simulate a complete sync BEFORE dispatching anything else - dis.dispatch({ - action: 'MatrixActions.sync', - prevState: null, - state: 'PREPARED', - matrixClient: client, - }, true); - - // Simulate joined groups being received - dis.dispatch({ - action: 'GroupActions.fetchJoinedGroups.success', - result: { - groups: ['+group:domain'], - }, - }, true); - - // Simulate receiving tag ordering account data - dis.dispatch({ - action: 'MatrixActions.accountData', - event_type: 'im.vector.web.tag_ordering', - event_content: { - tags: ['+group:domain'], - }, - }, true); - - // GroupStore is not flux, mock and notify - GroupStore.getGroupRooms = (groupId) => { - return [movingRoom]; - }; - GroupStore._notifyListeners(); - - // We also have to mock the client's getGroup function for the room list to filter it. - // It's not smart enough to tell the difference between a real group and a template though. - client.getGroup = (groupId) => { - return { groupId }; - }; - - // Select tag - dis.dispatch({ action: 'select_tag', tag: '+group:domain' }, true); - } - - beforeEach(() => { - setupSelectedTag(); - }); - - it('displays the correct rooms when the groups rooms are changed', async () => { - GroupStore.getGroupRooms = (groupId) => { - return [movingRoom, otherRoom]; - }; - GroupStore._notifyListeners(); - - await waitForRoomListStoreUpdate(); - - // XXX: Even though the store updated, it can take a bit before the update makes - // it to the components. This gives it plenty of time to figure out what to do. - await (new Promise(resolve => setTimeout(resolve, 500))); - - expectRoomInSubList(otherRoom, (s) => s.props.tagId === DefaultTagID.Untagged); - }); - - itDoesCorrectOptimisticUpdatesForDraggedRoomTiles(); - }); + itDoesCorrectOptimisticUpdatesForDraggedRoomTiles(); }); diff --git a/test/stores/SpaceStore-setup.ts b/test/stores/SpaceStore-setup.ts deleted file mode 100644 index 78418d45cc..0000000000 --- a/test/stores/SpaceStore-setup.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2021 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This needs to be executed before the SpaceStore gets imported but due to ES6 import hoisting we have to do this here. -// SpaceStore reads the SettingsStore which needs the localStorage values set at init time. - -localStorage.setItem("mx_labs_feature_feature_spaces", "true"); diff --git a/test/stores/SpaceStore-test.ts b/test/stores/SpaceStore-test.ts index 2e823aa72b..49b9569e4e 100644 --- a/test/stores/SpaceStore-test.ts +++ b/test/stores/SpaceStore-test.ts @@ -18,7 +18,6 @@ import { EventEmitter } from "events"; import { EventType } from "matrix-js-sdk/src/@types/event"; import { RoomMember } from "matrix-js-sdk/src/models/room-member"; -import "./SpaceStore-setup"; // enable space lab import "../skinned-sdk"; // Must be first for skinning to work import SpaceStore, { UPDATE_HOME_BEHAVIOUR, diff --git a/test/stores/room-list/SpaceWatcher-test.ts b/test/stores/room-list/SpaceWatcher-test.ts index 85f79c75b6..a0630dc07f 100644 --- a/test/stores/room-list/SpaceWatcher-test.ts +++ b/test/stores/room-list/SpaceWatcher-test.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../SpaceStore-setup"; // enable space lab import "../../skinned-sdk"; // Must be first for skinning to work import { SpaceWatcher } from "../../../src/stores/room-list/SpaceWatcher"; import type { RoomListStoreClass } from "../../../src/stores/room-list/RoomListStore";