Merge pull request #4076 from vector-im/luke/fix-tests-that-expect-directory

Fix some tests that expect Directory (they should expect HomePage)
This commit is contained in:
Matthew Hodgson 2017-05-30 15:24:46 +01:00 committed by GitHub
commit e358ef5bf7
1 changed files with 11 additions and 11 deletions

View File

@ -273,7 +273,7 @@ describe('loading:', function () {
localStorage.setItem("mx_user_id", "@me:localhost");
});
it('shows a directory by default if we have no joined rooms', function(done) {
it('shows a home page by default if we have no joined rooms', function(done) {
httpBackend.when('GET', '/pushrules').respond(200, {});
httpBackend.when('POST', '/filter').respond(200, { filter_id: 'fid' });
@ -283,11 +283,11 @@ describe('loading:', function () {
// we got a sync spinner - let the sync complete
return expectAndAwaitSync();
}).then(() => {
// once the sync completes, we should have a directory
// once the sync completes, we should have a home page
httpBackend.verifyNoOutstandingExpectation();
ReactTestUtils.findRenderedComponentWithType(
matrixChat, sdk.getComponent('structures.RoomDirectory'));
expect(windowLocation.hash).toEqual("#/directory");
matrixChat, sdk.getComponent('structures.HomePage'));
expect(windowLocation.hash).toEqual("#/home");
}).done(done, done);
});
@ -314,7 +314,7 @@ describe('loading:', function () {
});
describe('Guest auto-registration:', function() {
it('shows a directory by default', function (done) {
it('shows a home page by default', function (done) {
loadApp();
q.delay(1).then(() => {
@ -336,11 +336,11 @@ describe('loading:', function () {
// we got a sync spinner - let the sync complete
return expectAndAwaitSync();
}).then(() => {
// once the sync completes, we should have a directory
// once the sync completes, we should have a home page
httpBackend.verifyNoOutstandingExpectation();
ReactTestUtils.findRenderedComponentWithType(
matrixChat, sdk.getComponent('structures.RoomDirectory'));
expect(windowLocation.hash).toEqual("#/directory");
matrixChat, sdk.getComponent('structures.HomePage'));
expect(windowLocation.hash).toEqual("#/home");
}).done(done, done);
});
@ -371,11 +371,11 @@ describe('loading:', function () {
}).then((req) => {
expect(req.path).toMatch(new RegExp("^https://homeserver/"));
// once the sync completes, we should have a directory
// once the sync completes, we should have a home page
httpBackend.verifyNoOutstandingExpectation();
ReactTestUtils.findRenderedComponentWithType(
matrixChat, sdk.getComponent('structures.RoomDirectory'));
expect(windowLocation.hash).toEqual("#/directory");
matrixChat, sdk.getComponent('structures.HomePage'));
expect(windowLocation.hash).toEqual("#/home");
expect(MatrixClientPeg.get().baseUrl).toEqual("https://homeserver");
expect(MatrixClientPeg.get().idBaseUrl).toEqual("https://idserver");
}).done(done, done);