mirror of https://github.com/vector-im/riot-web
Merge pull request #8525 from vector-im/jryans/welcome-page-cleanup
Repair app loading tests after welcome pagepull/8550/head
commit
76f21abcdc
|
@ -78,7 +78,7 @@ module.exports = function (config) {
|
||||||
watched: false, included: false, served: true, nocache: false,
|
watched: false, included: false, served: true, nocache: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pattern: 'res/themes/**',
|
pattern: 'res/**',
|
||||||
watched: false, included: false, served: true, nocache: false,
|
watched: false, included: false, served: true, nocache: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -87,6 +87,8 @@ module.exports = function (config) {
|
||||||
// redirect img links to the karma server. See above.
|
// redirect img links to the karma server. See above.
|
||||||
"/img/": "/base/node_modules/matrix-react-sdk/res/img/",
|
"/img/": "/base/node_modules/matrix-react-sdk/res/img/",
|
||||||
"/themes/": "/base/res/themes/",
|
"/themes/": "/base/res/themes/",
|
||||||
|
"/welcome.html": "/base/res/welcome.html",
|
||||||
|
"/welcome/": "/base/res/welcome/",
|
||||||
},
|
},
|
||||||
|
|
||||||
// preprocess matching files before serving them to the browser
|
// preprocess matching files before serving them to the browser
|
||||||
|
|
|
@ -222,8 +222,7 @@ describe('loading:', function() {
|
||||||
}).done(done, done);
|
}).done(done, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('should follow the original link after successful login', function(done) {
|
||||||
/* it('should follow the original link after successful login', function(done) {
|
|
||||||
loadApp({
|
loadApp({
|
||||||
uriFragment: "#/room/!room:id",
|
uriFragment: "#/room/!room:id",
|
||||||
});
|
});
|
||||||
|
@ -258,10 +257,9 @@ describe('loading:', function() {
|
||||||
expect(localStorage.getItem('mx_hs_url')).toEqual(DEFAULT_HS_URL);
|
expect(localStorage.getItem('mx_hs_url')).toEqual(DEFAULT_HS_URL);
|
||||||
expect(localStorage.getItem('mx_is_url')).toEqual(DEFAULT_IS_URL);
|
expect(localStorage.getItem('mx_is_url')).toEqual(DEFAULT_IS_URL);
|
||||||
}).done(done, done);
|
}).done(done, done);
|
||||||
}); */
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('should not register as a guest when using a #/login link', function() {
|
||||||
/* it('should not register as a guest when using a #/login link', function() {
|
|
||||||
loadApp({
|
loadApp({
|
||||||
uriFragment: "#/login",
|
uriFragment: "#/login",
|
||||||
});
|
});
|
||||||
|
@ -288,7 +286,7 @@ describe('loading:', function() {
|
||||||
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
|
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
|
||||||
expect(windowLocation.hash).toEqual("#/home");
|
expect(windowLocation.hash).toEqual("#/home");
|
||||||
});
|
});
|
||||||
}); */
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("MatrixClient rehydrated from stored credentials:", function() {
|
describe("MatrixClient rehydrated from stored credentials:", function() {
|
||||||
|
@ -300,8 +298,7 @@ describe('loading:', function() {
|
||||||
localStorage.setItem("mx_last_room_id", "!last_room:id");
|
localStorage.setItem("mx_last_room_id", "!last_room:id");
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('shows the last known room by default', function() {
|
||||||
/* it('shows the last known room by default', function() {
|
|
||||||
httpBackend.when('GET', '/pushrules').respond(200, {});
|
httpBackend.when('GET', '/pushrules').respond(200, {});
|
||||||
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
|
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
|
||||||
|
|
||||||
|
@ -357,7 +354,7 @@ describe('loading:', function() {
|
||||||
httpBackend.verifyNoOutstandingExpectation();
|
httpBackend.verifyNoOutstandingExpectation();
|
||||||
expect(windowLocation.hash).toEqual("#/room/!room:id");
|
expect(windowLocation.hash).toEqual("#/room/!room:id");
|
||||||
}).done(done, done);
|
}).done(done, done);
|
||||||
}); */
|
});
|
||||||
|
|
||||||
describe('/#/login link:', function() {
|
describe('/#/login link:', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
@ -387,8 +384,7 @@ describe('loading:', function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('shows the homepage after login', function() {
|
||||||
/* it('shows the homepage after login', function() {
|
|
||||||
return completeLogin(matrixChat).then(() => {
|
return completeLogin(matrixChat).then(() => {
|
||||||
// we should see a home page, even though we previously had
|
// we should see a home page, even though we previously had
|
||||||
// a stored mx_last_room_id
|
// a stored mx_last_room_id
|
||||||
|
@ -396,13 +392,12 @@ describe('loading:', function() {
|
||||||
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
|
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
|
||||||
expect(windowLocation.hash).toEqual("#/home");
|
expect(windowLocation.hash).toEqual("#/home");
|
||||||
});
|
});
|
||||||
}); */
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Guest auto-registration:', function() {
|
describe('Guest auto-registration:', function() {
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('shows a welcome page by default', function(done) {
|
||||||
/* it('shows a welcome page by default', function(done) {
|
|
||||||
loadApp();
|
loadApp();
|
||||||
|
|
||||||
Promise.delay(1).then(() => {
|
Promise.delay(1).then(() => {
|
||||||
|
@ -430,10 +425,9 @@ describe('loading:', function() {
|
||||||
matrixChat, sdk.getComponent('auth.Welcome'));
|
matrixChat, sdk.getComponent('auth.Welcome'));
|
||||||
expect(windowLocation.hash).toEqual("#/welcome");
|
expect(windowLocation.hash).toEqual("#/welcome");
|
||||||
}).done(done, done);
|
}).done(done, done);
|
||||||
}); */
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('uses the default homeserver to register with', function(done) {
|
||||||
/* it('uses the default homeserver to register with', function(done) {
|
|
||||||
loadApp();
|
loadApp();
|
||||||
|
|
||||||
Promise.delay(1).then(() => {
|
Promise.delay(1).then(() => {
|
||||||
|
@ -457,15 +451,15 @@ describe('loading:', function() {
|
||||||
}).then((req) => {
|
}).then((req) => {
|
||||||
expect(req.path).toStartWith(DEFAULT_HS_URL);
|
expect(req.path).toStartWith(DEFAULT_HS_URL);
|
||||||
|
|
||||||
// once the sync completes, we should have a home page
|
// once the sync completes, we should have a welcome page
|
||||||
httpBackend.verifyNoOutstandingExpectation();
|
httpBackend.verifyNoOutstandingExpectation();
|
||||||
ReactTestUtils.findRenderedComponentWithType(
|
ReactTestUtils.findRenderedComponentWithType(
|
||||||
matrixChat, sdk.getComponent('structures.EmbeddedPage'));
|
matrixChat, sdk.getComponent('auth.Welcome'));
|
||||||
expect(windowLocation.hash).toEqual("#/home");
|
expect(windowLocation.hash).toEqual("#/welcome");
|
||||||
expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL);
|
expect(MatrixClientPeg.get().baseUrl).toEqual(DEFAULT_HS_URL);
|
||||||
expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL);
|
expect(MatrixClientPeg.get().idBaseUrl).toEqual(DEFAULT_IS_URL);
|
||||||
}).done(done, done);
|
}).done(done, done);
|
||||||
}); */
|
});
|
||||||
|
|
||||||
it('shows a room view if we followed a room link', function(done) {
|
it('shows a room view if we followed a room link', function(done) {
|
||||||
loadApp({
|
loadApp({
|
||||||
|
@ -534,15 +528,14 @@ describe('loading:', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Repair this test in https://github.com/vector-im/riot-web/issues/8468
|
it('should give us a login page', function() {
|
||||||
/* it('should give us a login page', function() {
|
|
||||||
expect(windowLocation.hash).toEqual("#/login");
|
expect(windowLocation.hash).toEqual("#/login");
|
||||||
|
|
||||||
// we expect a single <Login> component
|
// we expect a single <Login> component
|
||||||
ReactTestUtils.findRenderedComponentWithType(
|
ReactTestUtils.findRenderedComponentWithType(
|
||||||
matrixChat, sdk.getComponent('structures.auth.Login'),
|
matrixChat, sdk.getComponent('structures.auth.Login'),
|
||||||
);
|
);
|
||||||
}); */
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// ILAG renders this obsolete. I think.
|
// ILAG renders this obsolete. I think.
|
||||||
|
@ -684,8 +677,6 @@ function awaitSyncingSpinner(matrixChat, retryLimit, retryCount) {
|
||||||
|
|
||||||
console.log(Date.now() + " Awaiting sync spinner: load complete.");
|
console.log(Date.now() + " Awaiting sync spinner: load complete.");
|
||||||
|
|
||||||
// state looks good, check the rendered output
|
|
||||||
assertAtSyncingSpinner(matrixChat);
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue