@@ -154,6 +154,9 @@ describe('loading:', function () {
154
154
} ) . respond ( 403 , "Guest access is disabled" ) ;
155
155
156
156
return httpBackend . flush ( ) ;
157
+ } ) . then ( ( ) => {
158
+ // Wait for another trip around the event loop for the UI to update
159
+ return q . delay ( 1 ) ;
157
160
} ) . then ( ( ) => {
158
161
// we expect a single <Login> component
159
162
ReactTestUtils . findRenderedComponentWithType (
@@ -177,6 +180,9 @@ describe('loading:', function () {
177
180
} ) . respond ( 403 , "Guest access is disabled" ) ;
178
181
179
182
return httpBackend . flush ( ) ;
183
+ } ) . then ( ( ) => {
184
+ // Wait for another trip around the event loop for the UI to update
185
+ return q . delay ( 1 ) ;
180
186
} ) . then ( ( ) => {
181
187
// we expect a single <Login> component
182
188
let login = ReactTestUtils . findRenderedComponentWithType (
@@ -191,6 +197,9 @@ describe('loading:', function () {
191
197
} ) ;
192
198
login . onPasswordLogin ( "user" , "pass" )
193
199
return httpBackend . flush ( ) ;
200
+ } ) . then ( ( ) => {
201
+ // Wait for another trip around the event loop for the UI to update
202
+ return q . delay ( 1 ) ;
194
203
} ) . then ( ( ) => {
195
204
// we expect a spinner
196
205
ReactTestUtils . findRenderedComponentWithType (
@@ -200,6 +209,9 @@ describe('loading:', function () {
200
209
httpBackend . when ( 'POST' , '/filter' ) . respond ( 200 , { filter_id : 'fid' } ) ;
201
210
httpBackend . when ( 'GET' , '/sync' ) . respond ( 200 , { } ) ;
202
211
return httpBackend . flush ( ) ;
212
+ } ) . then ( ( ) => {
213
+ // Wait for another trip around the event loop for the UI to update
214
+ return q . delay ( 1 ) ;
203
215
} ) . then ( ( ) => {
204
216
// once the sync completes, we should have a room view
205
217
httpBackend . verifyNoOutstandingExpectation ( ) ;
@@ -287,6 +299,9 @@ describe('loading:', function () {
287
299
} ) ;
288
300
289
301
return httpBackend . flush ( ) ;
302
+ } ) . then ( ( ) => {
303
+ // Wait for another trip around the event loop for the UI to update
304
+ return q . delay ( 1 ) ;
290
305
} ) . then ( ( ) => {
291
306
// now we should have a spinner with a logout link
292
307
assertAtSyncingSpinner ( matrixChat ) ;
@@ -322,6 +337,9 @@ describe('loading:', function () {
322
337
} ) ;
323
338
324
339
return httpBackend . flush ( ) ;
340
+ } ) . then ( ( ) => {
341
+ // Wait for another trip around the event loop for the UI to update
342
+ return q . delay ( 1 ) ;
325
343
} ) . then ( ( ) => {
326
344
// now we should have a spinner with a logout link
327
345
assertAtSyncingSpinner ( matrixChat ) ;
@@ -358,12 +376,18 @@ describe('loading:', function () {
358
376
} ) ;
359
377
360
378
return httpBackend . flush ( ) ;
379
+ } ) . then ( ( ) => {
380
+ // Wait for another trip around the event loop for the UI to update
381
+ return q . delay ( 1 ) ;
361
382
} ) . then ( ( ) => {
362
383
// now we should have a spinner with a logout link
363
384
assertAtSyncingSpinner ( matrixChat ) ;
364
385
365
386
httpBackend . when ( 'GET' , '/sync' ) . respond ( 200 , { } ) ;
366
387
return httpBackend . flush ( ) ;
388
+ } ) . then ( ( ) => {
389
+ // Wait for another trip around the event loop for the UI to update
390
+ return q . delay ( 1 ) ;
367
391
} ) . then ( ( ) => {
368
392
// once the sync completes, we should have a room view
369
393
httpBackend . verifyNoOutstandingExpectation ( ) ;
0 commit comments