Skip to content

Commit 94de7fa

Browse files
committed
Update vulnerabilities.spec.js
1 parent e94448b commit 94de7fa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

spec/vulnerabilities.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,7 @@ describe('(GHSA-w54v-hf9p-8856) User enumeration via email verification endpoint
17751775
});
17761776

17771777
it('returns success for unverified email', async () => {
1778+
sendVerificationEmail.calls.reset();
17781779
const response = await request({
17791780
url: 'http://localhost:8378/1/verificationEmailRequest',
17801781
method: 'POST',
@@ -1787,6 +1788,8 @@ describe('(GHSA-w54v-hf9p-8856) User enumeration via email verification endpoint
17871788
});
17881789
expect(response.status).toBe(200);
17891790
expect(response.data).toEqual({});
1791+
await jasmine.timeout();
1792+
expect(sendVerificationEmail).toHaveBeenCalledTimes(1);
17901793
});
17911794

17921795
it('does not send verification email for non-existent email', async () => {
@@ -1864,6 +1867,22 @@ describe('(GHSA-w54v-hf9p-8856) User enumeration via email verification endpoint
18641867
}).catch(e => e);
18651868
expect(response.status).not.toBe(200);
18661869
});
1870+
1871+
it('sends verification email for unverified email', async () => {
1872+
sendVerificationEmail.calls.reset();
1873+
await request({
1874+
url: 'http://localhost:8378/1/verificationEmailRequest',
1875+
method: 'POST',
1876+
body: { email: 'unverified@example.com' },
1877+
headers: {
1878+
'X-Parse-Application-Id': Parse.applicationId,
1879+
'X-Parse-REST-API-Key': 'rest',
1880+
'Content-Type': 'application/json',
1881+
},
1882+
});
1883+
await jasmine.timeout();
1884+
expect(sendVerificationEmail).toHaveBeenCalledTimes(1);
1885+
});
18671886
});
18681887

18691888
it('rejects invalid emailVerifySuccessOnInvalidEmail values', async () => {

0 commit comments

Comments
 (0)