@@ -40,10 +40,10 @@ import * as test_utils from '../test-utils';
4040import MockHttpBackend from 'matrix-mock-request' ;
4141import { parseQs , parseQsFromFragment } from '../../src/vector/url_utils' ;
4242
43- var DEFAULT_HS_URL = 'http://my_server' ;
44- var DEFAULT_IS_URL = 'http://my_is' ;
43+ const DEFAULT_HS_URL = 'http://my_server' ;
44+ const DEFAULT_IS_URL = 'http://my_is' ;
4545
46- describe ( 'loading:' , function ( ) {
46+ describe ( 'loading:' , function ( ) {
4747 let parentDiv ;
4848 let httpBackend ;
4949
@@ -74,7 +74,7 @@ describe('loading:', function () {
7474 } ) ;
7575 } ) ;
7676
77- afterEach ( async function ( ) {
77+ afterEach ( async function ( ) {
7878 console . log ( `${ Date . now ( ) } : loading: afterEach` ) ;
7979 if ( parentDiv ) {
8080 ReactDOM . unmountComponentAtNode ( parentDiv ) ;
@@ -112,12 +112,12 @@ describe('loading:', function () {
112112 toString : function ( ) { return this . search + this . hash ; } ,
113113 } ;
114114
115- let tokenLoginCompleteDefer = Promise . defer ( ) ;
115+ const tokenLoginCompleteDefer = Promise . defer ( ) ;
116116 tokenLoginCompletePromise = tokenLoginCompleteDefer . promise ;
117117
118118 function onNewScreen ( screen ) {
119119 console . log ( Date . now ( ) + " newscreen " + screen ) ;
120- var hash = '#/' + screen ;
120+ const hash = '#/' + screen ;
121121 windowLocation . hash = hash ;
122122 console . log ( Date . now ( ) + " browser URI now " + windowLocation ) ;
123123 }
@@ -129,7 +129,7 @@ describe('loading:', function () {
129129 return {
130130 screen : fragparts . location . substring ( 1 ) ,
131131 params : fragparts . params ,
132- }
132+ } ;
133133 }
134134
135135 const MatrixChat = sdk . getComponent ( 'structures.MatrixChat' ) ;
@@ -142,7 +142,7 @@ describe('loading:', function () {
142142
143143 PlatformPeg . set ( new Platform ( ) ) ;
144144
145- var params = parseQs ( windowLocation ) ;
145+ const params = parseQs ( windowLocation ) ;
146146 matrixChat = ReactDOM . render (
147147 < MatrixChat
148148 onNewScreen = { onNewScreen }
@@ -153,7 +153,7 @@ describe('loading:', function () {
153153 onTokenLoginCompleted = { ( ) => tokenLoginCompleteDefer . resolve ( ) }
154154 initialScreenAfterLogin = { getScreenFromLocation ( windowLocation ) }
155155 makeRegistrationUrl = { ( ) => { throw new Error ( 'Not implemented' ) ; } }
156- /> , parentDiv
156+ /> , parentDiv ,
157157 ) ;
158158 }
159159
@@ -179,7 +179,7 @@ describe('loading:', function () {
179179 }
180180
181181 describe ( "Clean load with no stored credentials:" , function ( ) {
182- it ( 'gives a login panel by default' , function ( done ) {
182+ it ( 'gives a login panel by default' , function ( done ) {
183183 loadApp ( ) ;
184184
185185 Promise . delay ( 1 ) . then ( ( ) => {
@@ -257,7 +257,6 @@ describe('loading:', function () {
257257 }
258258 return completeLogin ( matrixChat ) ;
259259 } ) . then ( ( ) => {
260-
261260 // once the sync completes, we should have a room view
262261 ReactTestUtils . findRenderedComponentWithType (
263262 matrixChat , sdk . getComponent ( 'structures.HomePage' ) ) ;
@@ -356,7 +355,7 @@ describe('loading:', function () {
356355 } ) ;
357356 return httpBackend . flush ( ) ;
358357 } ) . then ( ( ) => {
359- return awaitSyncingSpinner ( matrixChat )
358+ return awaitSyncingSpinner ( matrixChat ) ;
360359 } ) . then ( ( ) => {
361360 // we got a sync spinner - let the sync complete
362361 return expectAndAwaitSync ( ) ;
@@ -380,7 +379,7 @@ describe('loading:', function () {
380379 it ( 'shows a login view' , function ( ) {
381380 // we expect a single <Login> component
382381 ReactTestUtils . findRenderedComponentWithType (
383- matrixChat , sdk . getComponent ( 'structures.login.Login' )
382+ matrixChat , sdk . getComponent ( 'structures.login.Login' ) ,
384383 ) ;
385384
386385 // the only outstanding request should be a GET /login
@@ -408,7 +407,7 @@ describe('loading:', function () {
408407 } ) ;
409408
410409 describe ( 'Guest auto-registration:' , function ( ) {
411- it ( 'shows a home page by default' , function ( done ) {
410+ it ( 'shows a home page by default' , function ( done ) {
412411 loadApp ( ) ;
413412
414413 Promise . delay ( 1 ) . then ( ( ) => {
@@ -438,7 +437,7 @@ describe('loading:', function () {
438437 } ) . done ( done , done ) ;
439438 } ) ;
440439
441- it ( 'uses the last known homeserver to register with' , function ( done ) {
440+ it ( 'uses the last known homeserver to register with' , function ( done ) {
442441 localStorage . setItem ( "mx_hs_url" , "https://homeserver" ) ;
443442 localStorage . setItem ( "mx_is_url" , "https://idserver" ) ;
444443
@@ -477,7 +476,7 @@ describe('loading:', function () {
477476
478477 it ( 'shows a room view if we followed a room link' , function ( done ) {
479478 loadApp ( {
480- uriFragment : "#/room/!room:id"
479+ uriFragment : "#/room/!room:id" ,
481480 } ) ;
482481 Promise . delay ( 1 ) . then ( ( ) => {
483482 // at this point, we're trying to do a guest registration;
@@ -547,7 +546,7 @@ describe('loading:', function () {
547546
548547 // we expect a single <Login> component
549548 ReactTestUtils . findRenderedComponentWithType (
550- matrixChat , sdk . getComponent ( 'structures.login.Login' )
549+ matrixChat , sdk . getComponent ( 'structures.login.Login' ) ,
551550 ) ;
552551 } ) ;
553552
@@ -580,7 +579,7 @@ describe('loading:', function () {
580579 } ) ;
581580
582581 describe ( 'Token login:' , function ( ) {
583- it ( 'logs in successfully' , function ( done ) {
582+ it ( 'logs in successfully' , function ( done ) {
584583 loadApp ( {
585584 queryString : "?loginToken=secretToken&homeserver=https%3A%2F%2Fhomeserver&identityServer=https%3A%2F%2Fidserver" ,
586585 } ) ;
@@ -658,7 +657,7 @@ describe('loading:', function () {
658657
659658// assert that we are on the loading page
660659function assertAtLoadingSpinner ( matrixChat ) {
661- var domComponent = ReactDOM . findDOMNode ( matrixChat ) ;
660+ const domComponent = ReactDOM . findDOMNode ( matrixChat ) ;
662661 expect ( domComponent . className ) . toEqual ( "mx_MatrixChat_splash" ) ;
663662
664663 // just the spinner
@@ -697,12 +696,12 @@ function awaitSyncingSpinner(matrixChat, retryLimit, retryCount) {
697696}
698697
699698function assertAtSyncingSpinner ( matrixChat ) {
700- var domComponent = ReactDOM . findDOMNode ( matrixChat ) ;
699+ const domComponent = ReactDOM . findDOMNode ( matrixChat ) ;
701700 expect ( domComponent . className ) . toEqual ( "mx_MatrixChat_splash" ) ;
702701
703702 ReactTestUtils . findRenderedComponentWithType (
704703 matrixChat , sdk . getComponent ( 'elements.Spinner' ) ) ;
705- var logoutLink = ReactTestUtils . findRenderedDOMComponentWithTag (
704+ const logoutLink = ReactTestUtils . findRenderedDOMComponentWithTag (
706705 matrixChat , 'a' ) ;
707706 expect ( logoutLink . text ) . toEqual ( "Logout" ) ;
708707}
0 commit comments