Skip to content

Commit

Permalink
Merge pull request #8464 from vector-im/bwindels/removellfeatureflag
Browse files Browse the repository at this point in the history
fix app tests after force enabling lazy loading + removing feature flag
  • Loading branch information
bwindels committed Feb 8, 2019
2 parents 5030410 + 7587232 commit dee7a13
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/app-tests/loading.js
Expand Up @@ -172,12 +172,23 @@ describe('loading:', function() {
// http requests until we do.
//
// returns a promise resolving to the received request
async function expectAndAwaitSync(response) {
response = response || {};
async function expectAndAwaitSync(opts) {
let syncRequest = null;
const isGuest = opts && opts.isGuest;
if (!isGuest) {
httpBackend.when('GET', '/_matrix/client/versions')
.respond(200, {
"versions": ["r0.3.0"],
"unstable_features": {
"m.lazy_load_members": true
}
});
// the call to create the LL filter
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'llfid' });
}
httpBackend.when('GET', '/sync')
.check((r) => {syncRequest = r;})
.respond(200, response);
.respond(200, {});

for (let attempts = 10; attempts > 0; attempts--) {
console.log(Date.now() + " waiting for /sync");
Expand Down Expand Up @@ -404,7 +415,7 @@ describe('loading:', function() {
return awaitSyncingSpinner(matrixChat);
}).then(() => {
// we got a sync spinner - let the sync complete
return expectAndAwaitSync();
return expectAndAwaitSync({isGuest: true});
}).then(() => {
// once the sync completes, we should have a home page
httpBackend.verifyNoOutstandingExpectation();
Expand Down Expand Up @@ -434,7 +445,7 @@ describe('loading:', function() {
}).then(() => {
return awaitSyncingSpinner(matrixChat);
}).then(() => {
return expectAndAwaitSync();
return expectAndAwaitSync({isGuest: true});
}).then((req) => {
expect(req.path).toStartWith(DEFAULT_HS_URL);

Expand Down Expand Up @@ -468,7 +479,7 @@ describe('loading:', function() {
}).then(() => {
return awaitSyncingSpinner(matrixChat);
}).then(() => {
return expectAndAwaitSync();
return expectAndAwaitSync({isGuest: true});
}).then(() => {
// once the sync completes, we should have a room view
return awaitRoomView(matrixChat);
Expand Down

0 comments on commit dee7a13

Please sign in to comment.