fix: Incomplete user object in verifyEmail function if both username and email are changed (#8889)

This commit is contained in:
Manuel
2024-01-15 15:44:49 +01:00
committed by GitHub
parent 355baf9dfc
commit 1eb95aeb41
11 changed files with 129 additions and 43 deletions

View File

@@ -51,6 +51,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
user.setUsername('zxcv');
user.setEmail('testIfEnabled@parse.com');
await user.signUp();
await jasmine.timeout();
expect(emailAdapter.sendVerificationEmail).toHaveBeenCalled();
user.fetch().then(() => {
expect(user.get('emailVerified')).toEqual(false);
@@ -184,6 +185,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
user.setUsername('zxcv');
user.set('email', 'testSendSimpleAdapter@parse.com');
await user.signUp();
await jasmine.timeout();
expect(calls).toBe(1);
user
.fetch()
@@ -324,6 +326,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
user.setUsername('user');
user.set('email', 'user@example.com');
await user.signUp();
await jasmine.timeout();
expect(sendEmailOptions).not.toBeUndefined();
const response = await request({
url: sendEmailOptions.link,
@@ -635,6 +638,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
user.setUsername('zxcv');
user.set('email', 'user@parse.com');
await user.signUp();
await jasmine.timeout();
expect(emailSent).toBe(true);
done();
});
@@ -662,6 +666,7 @@ describe('Custom Pages, Email Verification, Password Reset', () => {
user.set('email', 'user@parse.com');
return user.signUp();
})
.then(() => jasmine.timeout())
.then(() => {
expect(sendEmailOptions).not.toBeUndefined();
request({