From 0480681006afc27a33a92f61e9f7fecc8a8d5b5d Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 14 Oct 2021 15:04:14 -0500 Subject: [PATCH] chore(ABtest): remove vestigial drop cap A/B test code --- test/api/unit/models/user.test.js | 14 -------------- website/server/models/user/methods.js | 18 ------------------ 2 files changed, 32 deletions(-) diff --git a/test/api/unit/models/user.test.js b/test/api/unit/models/user.test.js index eb462a20f4..27c61485d9 100644 --- a/test/api/unit/models/user.test.js +++ b/test/api/unit/models/user.test.js @@ -592,20 +592,6 @@ describe('User Model', () => { }); context('pre-save hook', () => { - it('enrolls users that signup through web in the Drop Cap AB test', async () => { - let user = new User(); - user.registeredThrough = 'habitica-web'; - user = await user.save(); - expect(user._ABtests.dropCapNotif).to.exist; - }); - - it('does not enroll users that signup through modal in the Drop Cap AB test', async () => { - let user = new User(); - user.registeredThrough = 'habitica-ios'; - user = await user.save(); - expect(user._ABtests.dropCapNotif).to.not.exist; - }); - it('marks the last news post as read for new users', async () => { const lastNewsPost = { _id: '1' }; sandbox.stub(NewsPost, 'lastNewsPost').returns(lastNewsPost); diff --git a/website/server/models/user/methods.js b/website/server/models/user/methods.js index 9f5ed8a9af..d92fd30557 100644 --- a/website/server/models/user/methods.js +++ b/website/server/models/user/methods.js @@ -525,21 +525,3 @@ schema.methods.getSecretData = function getSecretData () { return user.secret; }; - -// Enroll users in the Drop Cap A/B Test -schema.methods.enrollInDropCapABTest = function enrollInDropCapABTest (xClientHeader) { - // Only target users that use web for cron and aren't subscribed. - // Those using mobile aren't excluded as they may use it later - const isWeb = xClientHeader === 'habitica-web'; - - if (isWeb && !this._ABtests.dropCapNotif && !this.isSubscribed()) { - const testGroup = Math.random(); - // Enroll 100% of users, splitting them 50/50 - if (testGroup <= 0.50) { - this._ABtests.dropCapNotif = 'drop-cap-notif-enabled'; - } else { - this._ABtests.dropCapNotif = 'drop-cap-notif-disabled'; - } - this.markModified('_ABtests'); - } -};