@@ -119,6 +119,7 @@ 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
123
email
123
124
} ) ;
124
125
@@ -133,6 +134,7 @@ describe('sendEmailVerification', () => {
133
134
134
135
it ( 'should reload the user if the API returns a different email' , async ( ) => {
135
136
const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
137
+ requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
136
138
137
139
} ) ;
138
140
@@ -146,10 +148,59 @@ describe('sendEmailVerification', () => {
146
148
} ) ;
147
149
148
150
context ( 'on iOS' , ( ) => {
149
- it ( 'should pass action code parameters' , ( ) => { } ) ;
151
+ it ( 'should pass action code parameters' , async ( ) => {
152
+ const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
153
+ requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
154
+ email
155
+ } ) ;
156
+ await sendEmailVerification ( mockAuth , user , {
157
+ handleCodeInApp : true ,
158
+ iOS : {
159
+ bundleId : 'my-bundle' ,
160
+ appStoreId : 'my-appstore-id'
161
+ } ,
162
+ url : 'my-url' ,
163
+ dynamicLinkDomain : 'fdl-domain'
164
+ } ) ;
165
+
166
+ expect ( mock . calls [ 0 ] . request ) . to . eql ( {
167
+ requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
168
+ idToken,
169
+ continueUrl : 'my-url' ,
170
+ dynamicLinkDomain : 'fdl-domain' ,
171
+ canHandleCodeInApp : true ,
172
+ iosBundleId : 'my-bundle' ,
173
+ iosAppStoreId : 'my-appstore-id'
174
+ } ) ;
175
+ } ) ;
150
176
} ) ;
151
177
152
178
context ( 'on Android' , ( ) => {
153
- it ( 'should pass action code parameters' , ( ) => { } ) ;
179
+ it ( 'should pass action code parameters' , async ( ) => {
180
+ const mock = mockEndpoint ( Endpoint . SEND_OOB_CODE , {
181
+ requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
182
+ email
183
+ } ) ;
184
+ await sendEmailVerification ( mockAuth , user , {
185
+ handleCodeInApp : true ,
186
+ android : {
187
+ installApp : false ,
188
+ minimumVersion : 'my-version' ,
189
+ packageName : 'my-package'
190
+ } ,
191
+ url : 'my-url' ,
192
+ dynamicLinkDomain : 'fdl-domain'
193
+ } ) ;
194
+ expect ( mock . calls [ 0 ] . request ) . to . eql ( {
195
+ requestType : GetOobCodeRequestType . VERIFY_EMAIL ,
196
+ idToken,
197
+ continueUrl : 'my-url' ,
198
+ dynamicLinkDomain : 'fdl-domain' ,
199
+ canHandleCodeInApp : true ,
200
+ androidInstallApp : false ,
201
+ androidMinimumVersionCode : 'my-version' ,
202
+ androidPackageName : 'my-package'
203
+ } ) ;
204
+ } ) ;
154
205
} ) ;
155
206
} ) ;
0 commit comments