Move map attribution to top right (#8621)

Signed-off-by: Michael Weimann <michaelw@matrix.org>

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Weimann 2022-05-23 12:19:59 +02:00 committed by GitHub
parent 764b307e63
commit 1535ff0d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 71 additions and 13 deletions

View file

@ -79,6 +79,11 @@ describe('<MBeaconBody />', () => {
});
const modalSpy = jest.spyOn(Modal, 'createTrackedDialog').mockReturnValue(undefined);
beforeAll(() => {
maplibregl.AttributionControl = jest.fn();
});
beforeEach(() => {
jest.clearAllMocks();
});

View file

@ -56,6 +56,15 @@ describe("MLocationBody", () => {
wrappingComponent: MatrixClientContext.Provider,
wrappingComponentProps: { value: mockClient },
});
beforeAll(() => {
maplibregl.AttributionControl = jest.fn();
});
beforeEach(() => {
jest.clearAllMocks();
});
describe('with error', () => {
let sdkConfigSpy;

View file

@ -124,7 +124,20 @@ exports[`MLocationBody <MLocationBody> without error renders map correctly 1`] =
},
"_eventsCount": 1,
"_maxListeners": undefined,
"addControl": [MockFunction],
"addControl": [MockFunction] {
"calls": Array [
Array [
mockConstructor {},
"top-right",
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
},
"fitBounds": [MockFunction],
"removeControl": [MockFunction],
"setCenter": [MockFunction] {
@ -135,22 +148,12 @@ exports[`MLocationBody <MLocationBody> without error renders map correctly 1`] =
"lon": -0.1276,
},
],
Array [
Object {
"lat": 51.5076,
"lon": -0.1276,
},
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
Object {
"type": "return",
"value": undefined,
},
],
},
"setStyle": [MockFunction],