@@ -7,33 +7,33 @@ import oauth2Authorize from "core/oauth2-authorize"
77describe ( "OAuth2" , function ( ) {
88
99 let mockSchema = {
10- flow : ' accessCode' ,
11- authorizationUrl : ' https://testAuthorizationUrl'
12- } ;
10+ flow : " accessCode" ,
11+ authorizationUrl : " https://testAuthorizationUrl"
12+ }
1313
1414 let authConfig = {
1515 auth : { schema : { get : ( key ) => mockSchema [ key ] } } ,
1616 authActions : { } ,
1717 errActions : { } ,
1818 configs : { oauth2RedirectUrl : "" } ,
1919 authConfigs : { }
20- } ;
20+ }
2121
2222 describe ( "authorize redirect" , function ( ) {
2323
2424 it ( "should build redirectUrl" , function ( ) {
25- win . open = createSpy ( ) ;
26- oauth2Authorize ( authConfig ) ;
27- expect ( win . open . calls . length ) . toEqual ( 1 ) ;
28- expect ( win . open . calls [ 0 ] . arguments [ 0 ] ) . toMatch ( "https://testAuthorizationUrl?response_type=code&redirect_uri=&state=" ) ;
29- } ) ;
25+ win . open = createSpy ( )
26+ oauth2Authorize ( authConfig )
27+ expect ( win . open . calls . length ) . toEqual ( 1 )
28+ expect ( win . open . calls [ 0 ] . arguments [ 0 ] ) . toMatch ( "https://testAuthorizationUrl?response_type=code&redirect_uri=&state=" )
29+ } )
3030
3131 it ( "should build correct redirectUrl from authorizeUrl with query parameters" , function ( ) {
32- win . open = createSpy ( ) ;
33- mockSchema . authorizationUrl = ' https://testAuthorizationUrl?param=1' ;
34- oauth2Authorize ( authConfig ) ;
35- expect ( win . open . calls . length ) . toEqual ( 1 ) ;
36- expect ( win . open . calls [ 0 ] . arguments [ 0 ] ) . toMatch ( "https://testAuthorizationUrl?param=1&response_type=code&redirect_uri=&state=" ) ;
37- } ) ;
38- } ) ;
39- } ) ;
32+ win . open = createSpy ( )
33+ mockSchema . authorizationUrl = " https://testAuthorizationUrl?param=1"
34+ oauth2Authorize ( authConfig )
35+ expect ( win . open . calls . length ) . toEqual ( 1 )
36+ expect ( win . open . calls [ 0 ] . arguments [ 0 ] ) . toMatch ( "https://testAuthorizationUrl?param=1&response_type=code&redirect_uri=&state=" )
37+ } )
38+ } )
39+ } )
0 commit comments