From 15d0bd9271d69b2d39349c3f524360cf62dbafbc Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 6 Jun 2017 15:54:45 +0100 Subject: [PATCH] Partially revert https://github.com/vector-im/riot-web/pull/4201 The q.delay is needed to make sure (or at least reasonably sure...) that the login component has appeared by that point. The done handler needs to be the error callback too otherwise failures result in timeouts rather than the actual failure. --- test/app-tests/loading.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index 281e1bb7..b6e4324f 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -192,13 +192,15 @@ describe('loading:', function () { }).respond(403, "Guest access is disabled"); return httpBackend.flush(); + }).then(() => { + // Wait for another trip around the event loop for the UI to update + return q.delay(1); }).then(() => { // we expect a single component following session load ReactTestUtils.findRenderedComponentWithType( matrixChat, sdk.getComponent('structures.login.Login')); expect(windowLocation.hash).toEqual(""); - done(); - }); + }).done(done, done); }); it('should follow the original link after successful login', function(done) {