From dd6868c255281d6f63de46e725c76d99e0152334 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 10 Aug 2016 22:39:53 +0100 Subject: [PATCH] Fix joining test This had been broken by https://github.com/matrix-org/matrix-react-sdk/pull/399. Change the way we populate the matrixclient used for the joining tests. --- test/app-tests/joining.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/app-tests/joining.js b/test/app-tests/joining.js index 6580161b9..22b018d1d 100644 --- a/test/app-tests/joining.js +++ b/test/app-tests/joining.js @@ -47,7 +47,7 @@ describe('joining a room', function () { var parentDiv; var httpBackend; var matrixChat; - + beforeEach(function() { test_utils.beforeEach(this); httpBackend = new MockHttpBackend(); @@ -66,11 +66,11 @@ describe('joining a room', function () { parentDiv = null; } }); - + it('should not get stuck at a spinner', function(done) { var ROOM_ALIAS = '#alias:localhost'; var ROOM_ID = '!id:localhost'; - + httpBackend.when('PUT', '/presence/'+encodeURIComponent(USER_ID)+'/status') .respond(200, {}); httpBackend.when('GET', '/pushrules').respond(200, {}); @@ -80,14 +80,11 @@ describe('joining a room', function () { httpBackend.when('GET', '/directory/room/'+encodeURIComponent(ROOM_ALIAS)).respond(200, { room_id: ROOM_ID }); // start with a logged-in client - peg.replaceUsingCreds({ - homeserverUrl: HS_URL, - identityServerUrl: IS_URL, - userId: USER_ID, - accessToken: ACCESS_TOKEN, - guest: false, - }); - + localStorage.setItem("mx_hs_url", HS_URL ); + localStorage.setItem("mx_is_url", IS_URL ); + localStorage.setItem("mx_access_token", ACCESS_TOKEN ); + localStorage.setItem("mx_user_id", USER_ID); + var mc = ; matrixChat = ReactDOM.render(mc, parentDiv);