Fix a load of warnings in the tests

Stub things out to make the tests not throw warnings, so we can see the actual
problems.
This commit is contained in:
Richard van der Hoff 2016-10-10 17:51:26 +01:00
parent 515f10bd8b
commit 78c3d5943a
6 changed files with 52 additions and 19 deletions

View file

@ -18,6 +18,7 @@ describe('RoomView', function () {
var parentDiv;
beforeEach(function() {
test_utils.beforeEach(this);
sandbox = test_utils.stubClient();
parentDiv = document.createElement('div');
@ -57,11 +58,10 @@ describe('RoomView', function () {
it('joins by alias if given an alias', function (done) {
peg.get().getRoomIdForAlias.returns(q({room_id: "!randomcharacters:aser.ver"}));
peg.get().getProfileInfo.returns(q({displayname: "foo"}));
var parentDiv = document.createElement('div');
var roomView = ReactDOM.render(<RoomView roomAddress="#alias:ser.ver" />, parentDiv);
peg.get().joinRoom = sinon.spy();
process.nextTick(function() {
roomView.onJoinButtonClicked();
process.nextTick(function() {