mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Handle social auth in A/B testing (#8024)
* fix(AB-testing): handle social auth * refactor(AB-testing): move to pre save hooks
This commit is contained in:
committed by
Matteo Pagliazzi
parent
81b7eeeb71
commit
86c9bddc09
@@ -2,6 +2,7 @@ import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
getProperty,
|
||||
} from '../../../../../helpers/api-integration/v3';
|
||||
import passport from 'passport';
|
||||
|
||||
@@ -44,6 +45,15 @@ describe('POST /user/auth/social', () => {
|
||||
expect(response.newUser).to.be.true;
|
||||
});
|
||||
|
||||
it('enrolls a new user in an A/B test', async () => {
|
||||
await api.post(endpoint, {
|
||||
authResponse: {access_token: randomAccessToken}, // eslint-disable-line camelcase
|
||||
network,
|
||||
});
|
||||
|
||||
await expect(getProperty('users', user._id, '_ABtest')).to.eventually.be.a('string');
|
||||
});
|
||||
|
||||
it('logs an existing user in', async () => {
|
||||
await user.update({ 'auth.facebook.id': facebookId });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user