1- import login from '../src/index'
1+ import { oauthLoginUrl } from '../src/index'
22
33beforeAll ( ( ) => {
44 Math . random = jest . fn ( ( ) => 0.123 )
@@ -8,8 +8,8 @@ beforeAll(() => {
88// Math.random.mockRestore()
99// });
1010
11- test ( 'login ({clientId: "1234567890abcdef1234"})' , ( ) => {
12- expect ( login ( {
11+ test ( 'oauthLoginUrl ({clientId: "1234567890abcdef1234"})' , ( ) => {
12+ expect ( oauthLoginUrl ( {
1313 clientId : '1234567890abcdef1234'
1414 } ) ) . toEqual ( {
1515 allowSignup : true ,
@@ -22,8 +22,8 @@ test('login({clientId: "1234567890abcdef1234"})', () => {
2222 } )
2323} )
2424
25- test ( 'login ({clientId: "4321fedcba0987654321"})' , ( ) => {
26- expect ( login ( {
25+ test ( 'oauthLoginUrl ({clientId: "4321fedcba0987654321"})' , ( ) => {
26+ expect ( oauthLoginUrl ( {
2727 clientId : '4321fedcba0987654321'
2828 } ) ) . toEqual ( {
2929 allowSignup : true ,
@@ -37,7 +37,7 @@ test('login({clientId: "4321fedcba0987654321"})', () => {
3737} )
3838
3939test ( 'redirectUrl option' , ( ) => {
40- expect ( login ( {
40+ expect ( oauthLoginUrl ( {
4141 clientId : '1234567890abcdef1234' ,
4242 redirectUrl : 'https://example.com'
4343 } ) ) . toEqual ( {
@@ -52,7 +52,7 @@ test('redirectUrl option', () => {
5252} )
5353
5454test ( 'login option' , ( ) => {
55- expect ( login ( {
55+ expect ( oauthLoginUrl ( {
5656 clientId : '1234567890abcdef1234' ,
5757 login : 'octocat'
5858 } ) ) . toEqual ( {
@@ -67,7 +67,7 @@ test('login option', () => {
6767} )
6868
6969test ( 'scopes = []' , ( ) => {
70- expect ( login ( {
70+ expect ( oauthLoginUrl ( {
7171 clientId : '1234567890abcdef1234' ,
7272 login : 'octocat' ,
7373 scopes : [ ]
@@ -83,7 +83,7 @@ test('scopes = []', () => {
8383} )
8484
8585test ( 'scopes = ""' , ( ) => {
86- expect ( login ( {
86+ expect ( oauthLoginUrl ( {
8787 clientId : '1234567890abcdef1234' ,
8888 login : 'octocat' ,
8989 scopes : ''
@@ -99,7 +99,7 @@ test('scopes = ""', () => {
9999} )
100100
101101test ( 'scopes = "user,public_repo, gist notifications"' , ( ) => {
102- expect ( login ( {
102+ expect ( oauthLoginUrl ( {
103103 clientId : '1234567890abcdef1234' ,
104104 login : 'octocat' ,
105105 scopes : 'user,public_repo, gist notifications'
@@ -115,7 +115,7 @@ test('scopes = "user,public_repo, gist notifications"', () => {
115115} )
116116
117117test ( 'allowSignup = false' , ( ) => {
118- expect ( login ( {
118+ expect ( oauthLoginUrl ( {
119119 allowSignup : false ,
120120 clientId : '1234567890abcdef1234' ,
121121 login : 'octocat' ,
0 commit comments