1
- import login from '../src/index'
1
+ import { oauthLoginUrl } from '../src/index'
2
2
3
3
beforeAll ( ( ) => {
4
4
Math . random = jest . fn ( ( ) => 0.123 )
@@ -8,8 +8,8 @@ beforeAll(() => {
8
8
// Math.random.mockRestore()
9
9
// });
10
10
11
- test ( 'login ({clientId: "1234567890abcdef1234"})' , ( ) => {
12
- expect ( login ( {
11
+ test ( 'oauthLoginUrl ({clientId: "1234567890abcdef1234"})' , ( ) => {
12
+ expect ( oauthLoginUrl ( {
13
13
clientId : '1234567890abcdef1234'
14
14
} ) ) . toEqual ( {
15
15
allowSignup : true ,
@@ -22,8 +22,8 @@ test('login({clientId: "1234567890abcdef1234"})', () => {
22
22
} )
23
23
} )
24
24
25
- test ( 'login ({clientId: "4321fedcba0987654321"})' , ( ) => {
26
- expect ( login ( {
25
+ test ( 'oauthLoginUrl ({clientId: "4321fedcba0987654321"})' , ( ) => {
26
+ expect ( oauthLoginUrl ( {
27
27
clientId : '4321fedcba0987654321'
28
28
} ) ) . toEqual ( {
29
29
allowSignup : true ,
@@ -37,7 +37,7 @@ test('login({clientId: "4321fedcba0987654321"})', () => {
37
37
} )
38
38
39
39
test ( 'redirectUrl option' , ( ) => {
40
- expect ( login ( {
40
+ expect ( oauthLoginUrl ( {
41
41
clientId : '1234567890abcdef1234' ,
42
42
redirectUrl : 'https://example.com'
43
43
} ) ) . toEqual ( {
@@ -52,7 +52,7 @@ test('redirectUrl option', () => {
52
52
} )
53
53
54
54
test ( 'login option' , ( ) => {
55
- expect ( login ( {
55
+ expect ( oauthLoginUrl ( {
56
56
clientId : '1234567890abcdef1234' ,
57
57
login : 'octocat'
58
58
} ) ) . toEqual ( {
@@ -67,7 +67,7 @@ test('login option', () => {
67
67
} )
68
68
69
69
test ( 'scopes = []' , ( ) => {
70
- expect ( login ( {
70
+ expect ( oauthLoginUrl ( {
71
71
clientId : '1234567890abcdef1234' ,
72
72
login : 'octocat' ,
73
73
scopes : [ ]
@@ -83,7 +83,7 @@ test('scopes = []', () => {
83
83
} )
84
84
85
85
test ( 'scopes = ""' , ( ) => {
86
- expect ( login ( {
86
+ expect ( oauthLoginUrl ( {
87
87
clientId : '1234567890abcdef1234' ,
88
88
login : 'octocat' ,
89
89
scopes : ''
@@ -99,7 +99,7 @@ test('scopes = ""', () => {
99
99
} )
100
100
101
101
test ( 'scopes = "user,public_repo, gist notifications"' , ( ) => {
102
- expect ( login ( {
102
+ expect ( oauthLoginUrl ( {
103
103
clientId : '1234567890abcdef1234' ,
104
104
login : 'octocat' ,
105
105
scopes : 'user,public_repo, gist notifications'
@@ -115,7 +115,7 @@ test('scopes = "user,public_repo, gist notifications"', () => {
115
115
} )
116
116
117
117
test ( 'allowSignup = false' , ( ) => {
118
- expect ( login ( {
118
+ expect ( oauthLoginUrl ( {
119
119
allowSignup : false ,
120
120
clientId : '1234567890abcdef1234' ,
121
121
login : 'octocat' ,
0 commit comments