Update dependency maplibre-gl to v2 (#9699)

* Update dependency maplibre-gl to v2

* update types and mocks for maplibre 2.0

* prettier + strict fix

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
renovate[bot]
2022-12-18 23:17:15 +00:00
committed by GitHub
co-authored by renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Kerry Archibald
parent 9584388171
commit af3715821b
21 changed files with 97 additions and 104 deletions
@@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
// eslint-disable-next-line deprecate/import
import { mount } from "enzyme";
import maplibregl from "maplibre-gl";
import * as maplibregl from "maplibre-gl";
import { act } from "react-dom/test-utils";
import { Beacon, Room, RoomMember, MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix";
@@ -41,7 +41,8 @@ describe("<BeaconMarker />", () => {
const aliceMember = new RoomMember(roomId, aliceId);
const mockMap = new maplibregl.Map();
const mapOptions = { container: {} as unknown as HTMLElement, style: "" };
const mockMap = new maplibregl.Map(mapOptions);
const mockClient = getMockClientWithEventEmitter({
getClientWellKnown: jest.fn().mockReturnValue({
@@ -19,7 +19,7 @@ import React from "react";
import { mount, ReactWrapper } from "enzyme";
import { act } from "react-dom/test-utils";
import { MatrixClient, MatrixEvent, Room, RoomMember, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix";
import maplibregl from "maplibre-gl";
import * as maplibregl from "maplibre-gl";
import { mocked } from "jest-mock";
import BeaconViewDialog from "../../../../src/components/views/beacon/BeaconViewDialog";
@@ -58,7 +58,8 @@ describe("<BeaconViewDialog />", () => {
getVisibleRooms: jest.fn().mockReturnValue([]),
});
const mockMap = new maplibregl.Map();
const mapOptions = { container: {} as unknown as HTMLElement, style: "" };
const mockMap = new maplibregl.Map(mapOptions);
// make fresh rooms every time
// as we update room state
@@ -91,10 +92,6 @@ describe("<BeaconViewDialog />", () => {
component.setProps({});
});
beforeAll(() => {
maplibregl.AttributionControl = jest.fn();
});
beforeEach(() => {
jest.spyOn(OwnBeaconStore.instance, "getLiveBeaconIds").mockRestore();
jest.spyOn(OwnBeaconStore.instance, "getBeaconById").mockRestore();