Skip to content

Commit 0263f4d

Browse files
committed
Add missing test
1 parent 60114a6 commit 0263f4d

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

packages-exp/auth-exp/src/core/strategies/email.test.ts

+53-2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ describe('sendEmailVerification', () => {
119119

120120
it('should send the email verification', async () => {
121121
const mock = mockEndpoint(Endpoint.SEND_OOB_CODE, {
122+
requestType: GetOobCodeRequestType.VERIFY_EMAIL,
122123
email
123124
});
124125

@@ -133,6 +134,7 @@ describe('sendEmailVerification', () => {
133134

134135
it('should reload the user if the API returns a different email', async () => {
135136
const mock = mockEndpoint(Endpoint.SEND_OOB_CODE, {
137+
requestType: GetOobCodeRequestType.VERIFY_EMAIL,
136138
137139
});
138140

@@ -146,10 +148,59 @@ describe('sendEmailVerification', () => {
146148
});
147149

148150
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+
});
150176
});
151177

152178
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+
});
154205
});
155206
});

0 commit comments

Comments
 (0)