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.
This commit is contained in:
Richard van der Hoff 2016-08-10 22:39:53 +01:00
parent b742342062
commit dd6868c255

View file

@ -47,7 +47,7 @@ describe('joining a room', function () {
var parentDiv; var parentDiv;
var httpBackend; var httpBackend;
var matrixChat; var matrixChat;
beforeEach(function() { beforeEach(function() {
test_utils.beforeEach(this); test_utils.beforeEach(this);
httpBackend = new MockHttpBackend(); httpBackend = new MockHttpBackend();
@ -66,11 +66,11 @@ describe('joining a room', function () {
parentDiv = null; parentDiv = null;
} }
}); });
it('should not get stuck at a spinner', function(done) { it('should not get stuck at a spinner', function(done) {
var ROOM_ALIAS = '#alias:localhost'; var ROOM_ALIAS = '#alias:localhost';
var ROOM_ID = '!id:localhost'; var ROOM_ID = '!id:localhost';
httpBackend.when('PUT', '/presence/'+encodeURIComponent(USER_ID)+'/status') httpBackend.when('PUT', '/presence/'+encodeURIComponent(USER_ID)+'/status')
.respond(200, {}); .respond(200, {});
httpBackend.when('GET', '/pushrules').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 }); httpBackend.when('GET', '/directory/room/'+encodeURIComponent(ROOM_ALIAS)).respond(200, { room_id: ROOM_ID });
// start with a logged-in client // start with a logged-in client
peg.replaceUsingCreds({ localStorage.setItem("mx_hs_url", HS_URL );
homeserverUrl: HS_URL, localStorage.setItem("mx_is_url", IS_URL );
identityServerUrl: IS_URL, localStorage.setItem("mx_access_token", ACCESS_TOKEN );
userId: USER_ID, localStorage.setItem("mx_user_id", USER_ID);
accessToken: ACCESS_TOKEN,
guest: false,
});
var mc = <MatrixChat config={{}}/>; var mc = <MatrixChat config={{}}/>;
matrixChat = ReactDOM.render(mc, parentDiv); matrixChat = ReactDOM.render(mc, parentDiv);