Switch to importing most things from the main matrix-js-sdk export (#11406)

* Switch to importing most things from the main matrix-js-sdk export

* fix imports

* Iterate

* Fix tests
This commit is contained in:
Michael Telatynski 2023-08-15 16:00:17 +01:00 committed by GitHub
parent 0842559fb2
commit ad73b0c16e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 262 additions and 277 deletions

View file

@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render, RenderResult } from "@testing-library/react";
import { RoomMember } from "matrix-js-sdk/src/matrix";
import { LocationAssetType } from "matrix-js-sdk/src/@types/location";
import { RoomMember, LocationAssetType } from "matrix-js-sdk/src/matrix";
import LocationViewDialog from "../../../../src/components/views/location/LocationViewDialog";
import { TILE_SERVER_WK_KEY } from "../../../../src/utils/WellKnownUtils";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/
import { mocked } from "jest-mock";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { makeLocationContent } from "matrix-js-sdk/src/content-helpers";
import { ContentHelpers, MatrixClient } from "matrix-js-sdk/src/matrix";
import { LegacyLocationEventContent, MLocationEventContent } from "matrix-js-sdk/src/@types/location";
import { doMaybeLocalRoomAction } from "../../../../src/utils/local-room";
@ -30,10 +29,6 @@ jest.mock("../../../../src/utils/local-room", () => ({
doMaybeLocalRoomAction: jest.fn(),
}));
jest.mock("matrix-js-sdk/src/content-helpers", () => ({
makeLocationContent: jest.fn(),
}));
describe("shareLocation", () => {
const roomId = "!room:example.com";
const shareType = LocationShareType.Pin;
@ -42,6 +37,7 @@ describe("shareLocation", () => {
let shareLocationFn: ShareLocationFn;
beforeEach(() => {
const makeLocationContent = jest.spyOn(ContentHelpers, "makeLocationContent");
client = {
sendMessage: jest.fn(),
} as unknown as MatrixClient;