fix tests
parent
ece549bf71
commit
734a7ef6c8
|
@ -26,11 +26,13 @@ const sdk = require('matrix-react-sdk');
|
||||||
|
|
||||||
const MessagePanel = sdk.getComponent('structures.MessagePanel');
|
const MessagePanel = sdk.getComponent('structures.MessagePanel');
|
||||||
import MatrixClientPeg from '../../../src/MatrixClientPeg';
|
import MatrixClientPeg from '../../../src/MatrixClientPeg';
|
||||||
|
import Matrix from 'matrix-js-sdk';
|
||||||
|
|
||||||
const test_utils = require('test-utils');
|
const test_utils = require('test-utils');
|
||||||
const mockclock = require('mock-clock');
|
const mockclock = require('mock-clock');
|
||||||
|
|
||||||
let client;
|
let client;
|
||||||
|
const room = new Matrix.Room();
|
||||||
|
|
||||||
// wrap MessagePanel with a component which provides the MatrixClient in the context.
|
// wrap MessagePanel with a component which provides the MatrixClient in the context.
|
||||||
const WrappedMessagePanel = React.createClass({
|
const WrappedMessagePanel = React.createClass({
|
||||||
|
@ -45,7 +47,7 @@ const WrappedMessagePanel = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
return <MessagePanel {...this.props} />;
|
return <MessagePanel room={room} {...this.props} />;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,8 @@ describe('TimelinePanel', function() {
|
||||||
sandbox = test_utils.stubClient(sandbox);
|
sandbox = test_utils.stubClient(sandbox);
|
||||||
|
|
||||||
room = sinon.createStubInstance(jssdk.Room);
|
room = sinon.createStubInstance(jssdk.Room);
|
||||||
|
room.currentState = sinon.createStubInstance(jssdk.RoomState);
|
||||||
|
room.currentState.members = {};
|
||||||
room.roomId = ROOM_ID;
|
room.roomId = ROOM_ID;
|
||||||
|
|
||||||
timelineSet = sinon.createStubInstance(jssdk.EventTimelineSet);
|
timelineSet = sinon.createStubInstance(jssdk.EventTimelineSet);
|
||||||
|
|
Loading…
Reference in New Issue