Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add test for email verification not applying to auth sign-up #8740

Open
wants to merge 25 commits into
base: alpha
Choose a base branch
from
Open
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
34dc306
Added test for Facebook signup, login using await/async as first ste…
ashish-naik Sep 5, 2023
11d2a1f
Added test in ParseUser.spec.js for testing Facebook sign up followed…
ashish-naik Sep 6, 2023
fafd04f
Merge branch 'parse-community:alpha' into Facebook-signup-error206
ashish-naik Sep 6, 2023
ab72478
Update spec/ParseUser.spec.js
ashish-naik Sep 7, 2023
d5474d3
Doing reconfigure server with email adaptor options used in index.js.…
ashish-naik Sep 7, 2023
3d6b9c4
Kept only code that is failing the test. Renamed test.
ashish-naik Sep 8, 2023
8f11478
Updated test to use ExpectAsync and removed done()
ashish-naik Sep 8, 2023
46f8e10
Update spec/ParseUser.spec.js
mtrezza Sep 8, 2023
af1616c
Update spec/ParseUser.spec.js
mtrezza Sep 8, 2023
8e818c0
Update spec/ParseUser.spec.js
mtrezza Sep 8, 2023
def6bff
Update spec/ParseUser.spec.js
mtrezza Sep 8, 2023
b1e1bf6
Merge branch 'alpha' into Facebook-signup-error206
mtrezza Sep 16, 2023
fae2b44
authProvider is not set currently during auth sign up. Setting storag…
ashish-naik Sep 17, 2023
e01c9f5
authProvider is not set currently during auth sign up. Setting storag…
ashish-naik Sep 17, 2023
a945431
Committing changes done for testing.
ashish-naik Sep 19, 2023
dd5529c
Merge commit 'b1e1bf6708f5d32b2846e66de40f48fb0ec1dc86' into alpha
ashish-naik Sep 19, 2023
e118629
Merge branch 'alpha' into Facebook-signup-error206
ashish-naik Nov 26, 2023
7775f14
Merge branch 'alpha' into Facebook-signup-error206
mtrezza Mar 21, 2024
d3d0f7d
Merge branch 'parse-community:alpha' into alpha
ashish-naik May 5, 2024
c2063f5
Merge branch 'alpha' of https://github.com/ashish-naik/parse-server-F…
ashish-naik May 5, 2024
b78e784
Reproducing error using test
ashish-naik May 5, 2024
cf1b227
review
mtrezza May 5, 2024
5937c91
Added test to ParseUser.spec.js
ashish-naik May 12, 2024
266abe0
Update RestWrite.js for solution of Auth error
ashish-naik May 13, 2024
93485f2
Update ParseUser.spec.js - updated test
ashish-naik May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,35 @@ describe('Parse.User testing', () => {
done();
});

fit('log in with Facebook and save signed up User with verifyUserEmails=true and preventLoginWithUnverifiedEmail=true', async () => {
const emailAdapter = {
sendPasswordResetEmail: () => Promise.resolve(),
sendMail: () => Promise.resolve(),
};
await reconfigureServer({
appName: 'unused',
mtrezza marked this conversation as resolved.
Show resolved Hide resolved
verifyUserEmails: true,
preventLoginWithUnverifiedEmail: true,
emailAdapter: {
module: emailAdapter,
},
publicServerURL: 'http://localhost:8378/1',
ashish-naik marked this conversation as resolved.
Show resolved Hide resolved
});

const provider = getMockFacebookProvider();
mtrezza marked this conversation as resolved.
Show resolved Hide resolved
Parse.User._registerAuthenticationProvider(provider);
const user = await Parse.User._logInWith('facebook');
expect(user instanceof Parse.User).toBeTrue();
expect(Parse.User.current()).toEqual(user);
expect(user.extended()).toBeTrue();
expect(provider.authData.id).toBe(provider.synchronizedUserId);
expect(provider.authData.access_token).toBe(provider.synchronizedAuthToken);
expect(provider.authData.expiration_date).toBe(provider.synchronizedExpiration);
expect(user._isLinked('facebook')).toBeTrue();

mtrezza marked this conversation as resolved.
Show resolved Hide resolved
await expectAsync(user.save()).toBeResolved();
});

it('can not set authdata to null', async () => {
try {
const provider = getMockFacebookProvider();
Expand Down