@@ -24,11 +24,11 @@ import { mockEndpoint } from '../../../test/api/helper';
24
24
import { mockAuth , testUser } from '../../../test/mock_auth' ;
25
25
import * as mockFetch from '../../../test/mock_fetch' ;
26
26
import { Endpoint } from '../../api' ;
27
- import { GetOobCodeRequestType } from '../../api/authentication/email_and_password' ;
28
27
import { ServerError } from '../../api/errors' ;
29
28
import { ProviderId } from '../providers' ;
30
29
import * as location from '../util/location' ;
31
30
import { fetchSignInMethodsForEmail , sendEmailVerification } from './email' ;
31
+ import { Operation } from '../../model/action_code_info' ;
32
32
33
33
use ( chaiAsPromised ) ;
34
34
use ( sinonChai ) ;
@@ -119,38 +119,38 @@ describe('sendEmailVerification', () => {
119
119
120
120
it ( 'should send the email verification' , async ( ) => {
121
121
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
122
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
122
+ requestType : Operation . VERIFY_EMAIL ,
123
123
email
124
124
} ) ;
125
125
126
126
await sendEmailVerification ( mockAuth , user ) ;
127
127
128
128
expect ( reloadStub ) . to . not . have . been . called ;
129
129
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
130
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
130
+ requestType : Operation . VERIFY_EMAIL ,
131
131
idToken
132
132
} ) ;
133
133
} ) ;
134
134
135
135
it ( 'should reload the user if the API returns a different email' , async ( ) => {
136
136
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
137
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
137
+ requestType : Operation . VERIFY_EMAIL ,
138
138
139
139
} ) ;
140
140
141
141
await sendEmailVerification ( mockAuth , user ) ;
142
142
143
143
expect ( reloadStub ) . to . have . been . calledOnce ;
144
144
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
145
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
145
+ requestType : Operation . VERIFY_EMAIL ,
146
146
idToken
147
147
} ) ;
148
148
} ) ;
149
149
150
150
context ( 'on iOS' , ( ) => {
151
151
it ( 'should pass action code parameters' , async ( ) => {
152
152
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
153
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
153
+ requestType : Operation . VERIFY_EMAIL ,
154
154
email
155
155
} ) ;
156
156
await sendEmailVerification ( mockAuth , user , {
@@ -164,7 +164,7 @@ describe('sendEmailVerification', () => {
164
164
} ) ;
165
165
166
166
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
167
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
167
+ requestType : Operation . VERIFY_EMAIL ,
168
168
idToken,
169
169
continueUrl : 'my-url' ,
170
170
dynamicLinkDomain : 'fdl-domain' ,
@@ -178,7 +178,7 @@ describe('sendEmailVerification', () => {
178
178
context ( 'on Android' , ( ) => {
179
179
it ( 'should pass action code parameters' , async ( ) => {
180
180
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
181
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
181
+ requestType : Operation . VERIFY_EMAIL ,
182
182
email
183
183
} ) ;
184
184
await sendEmailVerification ( mockAuth , user , {
@@ -192,7 +192,7 @@ describe('sendEmailVerification', () => {
192
192
dynamicLinkDomain : 'fdl-domain'
193
193
} ) ;
194
194
expect ( mock . calls [ 0 ] . request ) . to . eql ( {
195
- requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
195
+ requestType : Operation . VERIFY_EMAIL ,
196
196
idToken,
197
197
continueUrl : 'my-url' ,
198
198
dynamicLinkDomain : 'fdl-domain' ,
0 commit comments