17
17
18
18
import { expect } from 'chai' ;
19
19
20
- import { Operation } from '@firebase/auth-types-exp' ;
20
+ import { ActionCodeOperation } from '@firebase/auth-types-exp' ;
21
21
22
22
import { ActionCodeURL } from './action_code_url' ;
23
23
@@ -32,7 +32,7 @@ describe('core/action_code_url', () => {
32
32
encodeURIComponent ( continueUrl ) +
33
33
'&languageCode=en&tenantId=TENANT_ID&state=bla' ;
34
34
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
35
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . EMAIL_SIGNIN ) ;
35
+ expect ( actionCodeUrl ! . operation ) . to . eq ( ActionCodeOperation . EMAIL_SIGNIN ) ;
36
36
expect ( actionCodeUrl ! . code ) . to . eq ( 'CODE' ) ;
37
37
expect ( actionCodeUrl ! . apiKey ) . to . eq ( 'API_KEY' ) ;
38
38
// ContinueUrl should be decoded.
@@ -48,7 +48,9 @@ describe('core/action_code_url', () => {
48
48
'oobCode=CODE&mode=signIn&apiKey=API_KEY&' +
49
49
'languageCode=en' ;
50
50
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
51
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . EMAIL_SIGNIN ) ;
51
+ expect ( actionCodeUrl ! . operation ) . to . eq (
52
+ ActionCodeOperation . EMAIL_SIGNIN
53
+ ) ;
52
54
} ) ;
53
55
54
56
it ( 'should identitfy VERIFY_AND_CHANGE_EMAIL' , ( ) => {
@@ -58,7 +60,7 @@ describe('core/action_code_url', () => {
58
60
'languageCode=en' ;
59
61
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
60
62
expect ( actionCodeUrl ! . operation ) . to . eq (
61
- Operation . VERIFY_AND_CHANGE_EMAIL
63
+ ActionCodeOperation . VERIFY_AND_CHANGE_EMAIL
62
64
) ;
63
65
} ) ;
64
66
@@ -68,7 +70,9 @@ describe('core/action_code_url', () => {
68
70
'oobCode=CODE&mode=verifyEmail&apiKey=API_KEY&' +
69
71
'languageCode=en' ;
70
72
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
71
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . VERIFY_EMAIL ) ;
73
+ expect ( actionCodeUrl ! . operation ) . to . eq (
74
+ ActionCodeOperation . VERIFY_EMAIL
75
+ ) ;
72
76
} ) ;
73
77
74
78
it ( 'should identitfy RECOVER_EMAIL' , ( ) => {
@@ -77,7 +81,9 @@ describe('core/action_code_url', () => {
77
81
'oobCode=CODE&mode=recoverEmail&apiKey=API_KEY&' +
78
82
'languageCode=en' ;
79
83
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
80
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . RECOVER_EMAIL ) ;
84
+ expect ( actionCodeUrl ! . operation ) . to . eq (
85
+ ActionCodeOperation . RECOVER_EMAIL
86
+ ) ;
81
87
} ) ;
82
88
83
89
it ( 'should identitfy PASSWORD_RESET' , ( ) => {
@@ -86,7 +92,9 @@ describe('core/action_code_url', () => {
86
92
'oobCode=CODE&mode=resetPassword&apiKey=API_KEY&' +
87
93
'languageCode=en' ;
88
94
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
89
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . PASSWORD_RESET ) ;
95
+ expect ( actionCodeUrl ! . operation ) . to . eq (
96
+ ActionCodeOperation . PASSWORD_RESET
97
+ ) ;
90
98
} ) ;
91
99
92
100
it ( 'should identitfy REVERT_SECOND_FACTOR_ADDITION' , ( ) => {
@@ -96,7 +104,7 @@ describe('core/action_code_url', () => {
96
104
'languageCode=en' ;
97
105
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
98
106
expect ( actionCodeUrl ! . operation ) . to . eq (
99
- Operation . REVERT_SECOND_FACTOR_ADDITION
107
+ ActionCodeOperation . REVERT_SECOND_FACTOR_ADDITION
100
108
) ;
101
109
} ) ;
102
110
} ) ;
@@ -106,7 +114,7 @@ describe('core/action_code_url', () => {
106
114
'https://www.example.com:8080/finishSignIn?' +
107
115
'oobCode=CODE&mode=signIn&apiKey=API_KEY&state=bla' ;
108
116
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
109
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . EMAIL_SIGNIN ) ;
117
+ expect ( actionCodeUrl ! . operation ) . to . eq ( ActionCodeOperation . EMAIL_SIGNIN ) ;
110
118
expect ( actionCodeUrl ! . code ) . to . eq ( 'CODE' ) ;
111
119
expect ( actionCodeUrl ! . apiKey ) . to . eq ( 'API_KEY' ) ;
112
120
expect ( actionCodeUrl ! . continueUrl ) . to . be . null ;
@@ -120,7 +128,7 @@ describe('core/action_code_url', () => {
120
128
'oobCode=CODE1&mode=signIn&apiKey=API_KEY1&state=bla' +
121
129
'#oobCode=CODE2&mode=signIn&apiKey=API_KEY2&state=bla' ;
122
130
const actionCodeUrl = ActionCodeURL . parseLink ( actionLink ) ;
123
- expect ( actionCodeUrl ! . operation ) . to . eq ( Operation . EMAIL_SIGNIN ) ;
131
+ expect ( actionCodeUrl ! . operation ) . to . eq ( ActionCodeOperation . EMAIL_SIGNIN ) ;
124
132
expect ( actionCodeUrl ! . code ) . to . eq ( 'CODE1' ) ;
125
133
expect ( actionCodeUrl ! . apiKey ) . to . eq ( 'API_KEY1' ) ;
126
134
expect ( actionCodeUrl ! . continueUrl ) . to . be . null ;
0 commit comments