Add customisation point to disable space creation (#7766)
* mock matchMedia in jest setup Signed-off-by: Kerry Archibald <kerrya@element.io> * use UIComponent.CreateSpaces in space panel Signed-off-by: Kerry Archibald <kerrya@element.io> * lint Signed-off-by: Kerry Archibald <kerrya@element.io> * hide add space in spacecontextmenu Signed-off-by: Kerry Archibald <kerrya@element.io> * use UIComponent customistations in space oom view add space button Signed-off-by: Kerry Archibald <kerrya@element.io> * copyright Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
6e8edbb418
commit
818fddd72c
11 changed files with 890 additions and 48 deletions
|
@ -22,3 +22,16 @@ configure({ adapter: new Adapter() });
|
|||
|
||||
// maplibre requires a createObjectURL mock
|
||||
global.URL.createObjectURL = jest.fn();
|
||||
|
||||
// matchMedia is not included in jsdom
|
||||
const mockMatchMedia = 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(),
|
||||
}));
|
||||
global.matchMedia = mockMatchMedia;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue