@@ -172,12 +172,23 @@ describe('loading:', function() {
172172 // http requests until we do.
173173 //
174174 // returns a promise resolving to the received request
175- async function expectAndAwaitSync ( response ) {
176- response = response || { } ;
175+ async function expectAndAwaitSync ( opts ) {
177176 let syncRequest = null ;
177+ const isGuest = opts && opts . isGuest ;
178+ if ( ! isGuest ) {
179+ httpBackend . when ( 'GET' , '/_matrix/client/versions' )
180+ . respond ( 200 , {
181+ "versions" : [ "r0.3.0" ] ,
182+ "unstable_features" : {
183+ "m.lazy_load_members" : true
184+ }
185+ } ) ;
186+ // the call to create the LL filter
187+ httpBackend . when ( 'POST' , '/filter' ) . respond ( 200 , { filter_id : 'llfid' } ) ;
188+ }
178189 httpBackend . when ( 'GET' , '/sync' )
179190 . check ( ( r ) => { syncRequest = r ; } )
180- . respond ( 200 , response ) ;
191+ . respond ( 200 , { } ) ;
181192
182193 for ( let attempts = 10 ; attempts > 0 ; attempts -- ) {
183194 console . log ( Date . now ( ) + " waiting for /sync" ) ;
@@ -404,7 +415,7 @@ describe('loading:', function() {
404415 return awaitSyncingSpinner ( matrixChat ) ;
405416 } ) . then ( ( ) => {
406417 // we got a sync spinner - let the sync complete
407- return expectAndAwaitSync ( ) ;
418+ return expectAndAwaitSync ( { isGuest : true } ) ;
408419 } ) . then ( ( ) => {
409420 // once the sync completes, we should have a home page
410421 httpBackend . verifyNoOutstandingExpectation ( ) ;
@@ -434,7 +445,7 @@ describe('loading:', function() {
434445 } ) . then ( ( ) => {
435446 return awaitSyncingSpinner ( matrixChat ) ;
436447 } ) . then ( ( ) => {
437- return expectAndAwaitSync ( ) ;
448+ return expectAndAwaitSync ( { isGuest : true } ) ;
438449 } ) . then ( ( req ) => {
439450 expect ( req . path ) . toStartWith ( DEFAULT_HS_URL ) ;
440451
@@ -468,7 +479,7 @@ describe('loading:', function() {
468479 } ) . then ( ( ) => {
469480 return awaitSyncingSpinner ( matrixChat ) ;
470481 } ) . then ( ( ) => {
471- return expectAndAwaitSync ( ) ;
482+ return expectAndAwaitSync ( { isGuest : true } ) ;
472483 } ) . then ( ( ) => {
473484 // once the sync completes, we should have a room view
474485 return awaitRoomView ( matrixChat ) ;
0 commit comments