1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/fix/17686

 Conflicts:
	src/components/views/avatars/RoomAvatar.tsx
	test/stores/SpaceStore-test.ts
	test/test-utils.js
This commit is contained in:
Michael Telatynski
2021-07-19 16:47:31 +01:00
104 changed files with 2492 additions and 2123 deletions

View File

@@ -16,7 +16,9 @@ limitations under the License.
import { EventEmitter } from "events";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import "./SpaceStore-setup"; // enable space lab
import "../skinned-sdk"; // Must be first for skinning to work
import SpaceStore, {
UPDATE_INVITED_SPACES,
@@ -26,13 +28,10 @@ import SpaceStore, {
import { resetAsyncStoreWithClient, setupAsyncStoreWithClient } from "../utils/test-utils";
import { mkEvent, mkStubRoom, stubClient } from "../test-utils";
import { EnhancedMap } from "../../src/utils/maps";
import SettingsStore from "../../src/settings/SettingsStore";
import DMRoomMap from "../../src/utils/DMRoomMap";
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
import defaultDispatcher from "../../src/dispatcher/dispatcher";
type MatrixEvent = any; // importing from js-sdk upsets things
jest.useFakeTimers();
const mockStateEventImplementation = (events: MatrixEvent[]) => {
@@ -53,9 +52,6 @@ const emitPromise = (e: EventEmitter, k: string | symbol) => new Promise(r => e.
const testUserId = "@test:user";
const getValue = jest.fn();
SettingsStore.getValue = getValue;
const getUserIdForRoomId = jest.fn();
// @ts-ignore
DMRoomMap.sharedInstance = { getUserIdForRoomId };
@@ -122,18 +118,6 @@ describe("SpaceStore", () => {
beforeEach(() => {
jest.runAllTimers();
client.getVisibleRooms.mockReturnValue(rooms = []);
getValue.mockImplementation(settingName => {
switch (settingName) {
case "feature_spaces":
return true;
case "feature_spaces.all_rooms":
return true;
case "feature_spaces.space_member_dms":
return true;
case "feature_spaces.space_dm_badges":
return false;
}
});
});
afterEach(async () => {
await resetAsyncStoreWithClient(store);