Apply prettier formatting

This commit is contained in:
Michael Weimann 2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
No known key found for this signature in database
GPG key ID: 53F535A266BB9584
1576 changed files with 65385 additions and 62478 deletions

View file

@ -14,23 +14,23 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import React from 'react';
import React from "react";
// eslint-disable-next-line deprecate/import
import { mount } from 'enzyme';
import { RoomMember } from 'matrix-js-sdk/src/matrix';
import { LocationAssetType } from 'matrix-js-sdk/src/@types/location';
import maplibregl from 'maplibre-gl';
import { mount } from "enzyme";
import { RoomMember } from "matrix-js-sdk/src/matrix";
import { LocationAssetType } from "matrix-js-sdk/src/@types/location";
import maplibregl from "maplibre-gl";
import LocationViewDialog from '../../../../src/components/views/location/LocationViewDialog';
import { TILE_SERVER_WK_KEY } from '../../../../src/utils/WellKnownUtils';
import { getMockClientWithEventEmitter, makeLocationEvent } from '../../../test-utils';
import LocationViewDialog from "../../../../src/components/views/location/LocationViewDialog";
import { TILE_SERVER_WK_KEY } from "../../../../src/utils/WellKnownUtils";
import { getMockClientWithEventEmitter, makeLocationEvent } from "../../../test-utils";
describe('<LocationViewDialog />', () => {
const roomId = '!room:server';
const userId = '@user:server';
describe("<LocationViewDialog />", () => {
const roomId = "!room:server";
const userId = "@user:server";
const mockClient = getMockClientWithEventEmitter({
getClientWellKnown: jest.fn().mockReturnValue({
[TILE_SERVER_WK_KEY.name]: { map_style_url: 'maps.com' },
[TILE_SERVER_WK_KEY.name]: { map_style_url: "maps.com" },
}),
isGuest: jest.fn().mockReturnValue(false),
});
@ -40,24 +40,23 @@ describe('<LocationViewDialog />', () => {
mxEvent: defaultEvent,
onFinished: jest.fn(),
};
const getComponent = (props = {}) =>
mount(<LocationViewDialog {...defaultProps} {...props} />);
const getComponent = (props = {}) => mount(<LocationViewDialog {...defaultProps} {...props} />);
beforeAll(() => {
maplibregl.AttributionControl = jest.fn();
});
it('renders map correctly', () => {
it("renders map correctly", () => {
const component = getComponent();
expect(component.find('Map')).toMatchSnapshot();
expect(component.find("Map")).toMatchSnapshot();
});
it('renders marker correctly for self share', () => {
it("renders marker correctly for self share", () => {
const selfShareEvent = makeLocationEvent("geo:51.5076,-0.1276", LocationAssetType.Self);
const member = new RoomMember(roomId, userId);
// @ts-ignore cheat assignment to property
selfShareEvent.sender = member;
const component = getComponent({ mxEvent: selfShareEvent });
expect(component.find('SmartMarker').props()['roomMember']).toEqual(member);
expect(component.find("SmartMarker").props()["roomMember"]).toEqual(member);
});
});