mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 01:35:49 +03:00
9b780e0e60
Adds static location share a la [MSC3488](https://github.com/matrix-org/matrix-doc/pull/3488) behind a labs flag, supporting legacy `m.location` `msgtype` too. Powered by https://github.com/matrix-org/matrix-react-sdk/pull/7135. Adds maplibre as a dependency. To make this work, you have to add a valid `map_style_url` to your config.json.
17 lines
585 B
JavaScript
17 lines
585 B
JavaScript
// https://jestjs.io/docs/en/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: jest.fn().mockImplementation(query => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: jest.fn(), // deprecated
|
|
removeListener: jest.fn(), // deprecated
|
|
addEventListener: jest.fn(),
|
|
removeEventListener: jest.fn(),
|
|
dispatchEvent: jest.fn(),
|
|
})),
|
|
});
|
|
|
|
// maplibre requires a createObjectURL mock
|
|
global.URL.createObjectURL = jest.fn();
|