Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix app tests after force enabling lazy loading + removing feature flag #8464

Merged
merged 1 commit into from
Feb 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions test/app-tests/loading.js
Original file line number Diff line number Diff line change
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