forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added MockedDeviceContext to voip unit tests (RocketChat#33553)
- Loading branch information
Showing
12 changed files
with
126 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { DeviceContextValue } from '@rocket.chat/ui-contexts'; | ||
import { DeviceContext } from '@rocket.chat/ui-contexts'; | ||
import React from 'react'; | ||
|
||
const mockDeviceContextValue: DeviceContextValue = { | ||
enabled: true, | ||
selectedAudioOutputDevice: undefined, | ||
selectedAudioInputDevice: undefined, | ||
availableAudioOutputDevices: [], | ||
availableAudioInputDevices: [], | ||
setAudioOutputDevice: () => undefined, | ||
setAudioInputDevice: () => undefined, | ||
}; | ||
|
||
type MockedDeviceContextProps = Partial<DeviceContextValue> & { | ||
children: React.ReactNode; | ||
}; | ||
|
||
export const MockedDeviceContext = ({ children, ...props }: MockedDeviceContextProps) => { | ||
return <DeviceContext.Provider value={{ ...mockDeviceContextValue, ...props }}>{children}</DeviceContext.Provider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.