diff --git a/test/api/unit/middlewares/cronMiddleware.js b/test/api/unit/middlewares/cronMiddleware.js index 7491d59c69..e3e797189d 100644 --- a/test/api/unit/middlewares/cronMiddleware.js +++ b/test/api/unit/middlewares/cronMiddleware.js @@ -311,25 +311,8 @@ describe('cron middleware', () => { }); }); - it('does not enroll 50% of users', async () => { - sandbox.stub(Math, 'random').returns(0.6); - user.lastCron = moment(new Date()).subtract({ days: 2 }); - await user.save(); - req.headers['x-client'] = 'habitica-web'; - - await new Promise((resolve, reject) => { - cronMiddleware(req, res, async err => { - if (err) return reject(err); - user = await User.findById(user._id).exec(); - expect(user._ABtests.dropCapNotif).to.be.equal('drop-cap-notif-not-enrolled'); - - return resolve(); - }); - }); - }); - - it('enables the new notification for 25% of users', async () => { - sandbox.stub(Math, 'random').returns(0.25); + it('enables the new notification for 50% of users', async () => { + sandbox.stub(Math, 'random').returns(0.5); user.lastCron = moment(new Date()).subtract({ days: 2 }); await user.save(); req.headers['x-client'] = 'habitica-web'; @@ -345,8 +328,8 @@ describe('cron middleware', () => { }); }); - it('disables the new notification for 25% of users', async () => { - sandbox.stub(Math, 'random').returns(0.5); + it('disables the new notification for 50% of users', async () => { + sandbox.stub(Math, 'random').returns(0.51); user.lastCron = moment(new Date()).subtract({ days: 2 }); await user.save(); req.headers['x-client'] = 'habitica-web'; diff --git a/website/server/libs/taskManager.js b/website/server/libs/taskManager.js index f63db73a83..a5d0f0ac88 100644 --- a/website/server/libs/taskManager.js +++ b/website/server/libs/taskManager.js @@ -464,12 +464,8 @@ async function scoreTask (user, task, direction, req, res) { user, }); - const isEnrolledInDropCapTest = user._ABtests.dropCapNotif - && user._ABtests.dropCapNotif !== 'drop-cap-notif-not-enrolled'; - // Track when new users (first 7 days) score tasks - // or if they're enrolled in the Drop Cap A/B Test - if (moment().diff(user.auth.timestamps.created, 'days') < 7 || isEnrolledInDropCapTest) { + if (moment().diff(user.auth.timestamps.created, 'days') < 7) { res.analytics.track('task score', { uuid: user._id, hitType: 'event', diff --git a/website/server/models/user/methods.js b/website/server/models/user/methods.js index fbe084b407..9f5ed8a9af 100644 --- a/website/server/models/user/methods.js +++ b/website/server/models/user/methods.js @@ -534,13 +534,11 @@ schema.methods.enrollInDropCapABTest = function enrollInDropCapABTest (xClientHe if (isWeb && !this._ABtests.dropCapNotif && !this.isSubscribed()) { const testGroup = Math.random(); - // Enroll 20% of users, splitting them 50/50 - if (testGroup <= 0.25) { + // Enroll 100% of users, splitting them 50/50 + if (testGroup <= 0.50) { this._ABtests.dropCapNotif = 'drop-cap-notif-enabled'; - } else if (testGroup <= 0.5) { - this._ABtests.dropCapNotif = 'drop-cap-notif-disabled'; } else { - this._ABtests.dropCapNotif = 'drop-cap-notif-not-enrolled'; + this._ABtests.dropCapNotif = 'drop-cap-notif-disabled'; } this.markModified('_ABtests'); }