diff --git a/src/client/__mocks__/window.js b/src/client/__mocks__/window.js index e589b8f..a56378b 100644 --- a/src/client/__mocks__/window.js +++ b/src/client/__mocks__/window.js @@ -4,7 +4,18 @@ export const createObjectURL = jest.fn() .mockImplementation(object => 'blob://' + String(object)) export const revokeObjectURL = jest.fn() -export class MediaStream {} +export class MediaStream { + getVideoTracks () { + return [{ + enabled: true + }] + } + getAudioTracks () { + return [{ + enabled: true + }] + } +} export function getUserMedia () { return !getUserMedia.shouldFail ? Promise.resolve(getUserMedia.stream) diff --git a/src/client/components/App.js b/src/client/components/App.js index f305d74..adc122f 100644 --- a/src/client/components/App.js +++ b/src/client/components/App.js @@ -23,6 +23,12 @@ export default class App extends React.PureComponent { streams: PropTypes.objectOf(StreamPropType).isRequired, toggleActive: PropTypes.func.isRequired } + constructor () { + super() + this.state = { + videos: {} + } + } componentDidMount () { const { init } = this.props init() @@ -41,17 +47,29 @@ export default class App extends React.PureComponent { streams } = this.props + const { videos } = this.state + return (