mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
chore(ABtest): remove vestigial drop cap A/B test code
This commit is contained in:
parent
ab20b5e6cd
commit
0480681006
2 changed files with 0 additions and 32 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue