1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Extract requestMediaPermissions (#9568)

This commit is contained in:
Michael Weimann
2022-11-11 10:38:51 +01:00
committed by GitHub
parent f2f00f68ba
commit fca6ff271c
11 changed files with 196 additions and 53 deletions

View File

@ -86,3 +86,11 @@ fetchMock.catch("");
fetchMock.get("/image-file-stub", "image file stub");
// @ts-ignore
window.fetch = fetchMock.sandbox();
// set up mediaDevices mock
Object.defineProperty(navigator, "mediaDevices", {
value: {
enumerateDevices: jest.fn().mockResolvedValue([]),
getUserMedia: jest.fn(),
},
});