Skip to content

Commit 1acbe81

Browse files
committed
fix tests
1 parent c899909 commit 1acbe81

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/app/auth/components/verify/verify.component.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('VerifyComponent', () => {
9191
// });
9292

9393
it('should require only email verification if only email unverified', async () => {
94-
await init();
94+
await init(defaultAuthData, { sendEmail: true });
9595

9696
expect(component.verifyingEmail).toBeTruthy();
9797
expect(component.needsEmail).toBeTruthy();
@@ -100,16 +100,15 @@ describe('VerifyComponent', () => {
100100

101101
it('should require only phone verification if only phone unverified', async () => {
102102
const unverifiedPhoneData = require('@root/test/responses/auth.verify.unverifiedPhone.success.json');
103-
await init(unverifiedPhoneData);
104-
103+
await init(unverifiedPhoneData, { sendSms: true });
105104
expect(component.verifyingPhone).toBeTruthy();
106105
expect(component.needsPhone).toBeTruthy();
107106
expect(component.needsEmail).toBeFalsy();
108107
});
109108

110109
it('should require verification of both if both unverified, and verify email first', async () => {
111110
const unverifiedBothData = require('@root/test/responses/auth.verify.unverifiedBoth.success.json');
112-
await init(unverifiedBothData);
111+
await init(unverifiedBothData, { sendEmail: true, sendSms: true });
113112

114113
expect(component.verifyingEmail).toBeTruthy();
115114
expect(component.needsPhone).toBeTruthy();
@@ -118,7 +117,7 @@ describe('VerifyComponent', () => {
118117

119118
it('should verify email and then switch to phone verification if needed', async () => {
120119
const unverifiedBothData = require('@root/test/responses/auth.verify.unverifiedBoth.success.json');
121-
await init(unverifiedBothData);
120+
await init(unverifiedBothData, { sendEmail: true, sendSms: true });
122121

123122
expect(component.verifyingEmail).toBeTruthy();
124123
expect(component.needsPhone).toBeTruthy();
@@ -141,7 +140,7 @@ describe('VerifyComponent', () => {
141140

142141
it('should verify email and redirect if only email needed', async () => {
143142
const unverifiedEmailData = require('@root/test/responses/auth.verify.unverifiedEmail.success.json');
144-
await init(unverifiedEmailData);
143+
await init(unverifiedEmailData, { sendEmail: true });
145144

146145
const finishSpy = spyOn(component, 'finish');
147146

@@ -165,7 +164,7 @@ describe('VerifyComponent', () => {
165164

166165
it('should verify phone and redirect if only phone needed', async () => {
167166
const unverifiedPhoneData = require('@root/test/responses/auth.verify.unverifiedPhone.success.json');
168-
await init(unverifiedPhoneData);
167+
await init(unverifiedPhoneData, { sendSms: true });
169168

170169
const finishSpy = spyOn(component, 'finish');
171170

@@ -190,7 +189,7 @@ describe('VerifyComponent', () => {
190189

191190
it('should show CAPTCHA before verifying phone', async () => {
192191
const unverifiedPhoneData = require('@root/test/responses/auth.verify.unverifiedPhone.success.json');
193-
await init(unverifiedPhoneData);
192+
await init(unverifiedPhoneData, { sendSms: true });
194193

195194
// Testing environments might not have the site key enabled,
196195
// so force captchaEnabled to be true.

0 commit comments

Comments
 (0)