mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Merge branch 'release' into develop
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "habitica",
|
"name": "habitica",
|
||||||
"version": "4.165.0",
|
"version": "4.165.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "habitica",
|
"name": "habitica",
|
||||||
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
|
||||||
"version": "4.165.0",
|
"version": "4.165.1",
|
||||||
"main": "./website/server/index.js",
|
"main": "./website/server/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.11.6",
|
"@babel/core": "^7.11.6",
|
||||||
|
|||||||
@@ -311,8 +311,8 @@ describe('cron middleware', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not enroll 80% of users', async () => {
|
it('does not enroll 50% of users', async () => {
|
||||||
sandbox.stub(Math, 'random').returns(0.5);
|
sandbox.stub(Math, 'random').returns(0.6);
|
||||||
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
||||||
await user.save();
|
await user.save();
|
||||||
req.headers['x-client'] = 'habitica-web';
|
req.headers['x-client'] = 'habitica-web';
|
||||||
@@ -328,8 +328,8 @@ describe('cron middleware', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('enables the new notification for 10% of users', async () => {
|
it('enables the new notification for 25% of users', async () => {
|
||||||
sandbox.stub(Math, 'random').returns(0.1);
|
sandbox.stub(Math, 'random').returns(0.25);
|
||||||
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
||||||
await user.save();
|
await user.save();
|
||||||
req.headers['x-client'] = 'habitica-web';
|
req.headers['x-client'] = 'habitica-web';
|
||||||
@@ -345,8 +345,8 @@ describe('cron middleware', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('disables the new notification for 10% of users', async () => {
|
it('disables the new notification for 25% of users', async () => {
|
||||||
sandbox.stub(Math, 'random').returns(0.2);
|
sandbox.stub(Math, 'random').returns(0.5);
|
||||||
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
user.lastCron = moment(new Date()).subtract({ days: 2 });
|
||||||
await user.save();
|
await user.save();
|
||||||
req.headers['x-client'] = 'habitica-web';
|
req.headers['x-client'] = 'habitica-web';
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ function dropCapABTest (user, req) {
|
|||||||
if (isWeb && !user._ABtests.dropCapNotif && !user.isSubscribed()) {
|
if (isWeb && !user._ABtests.dropCapNotif && !user.isSubscribed()) {
|
||||||
const testGroup = Math.random();
|
const testGroup = Math.random();
|
||||||
// Enroll 20% of users, splitting them 50/50
|
// Enroll 20% of users, splitting them 50/50
|
||||||
if (testGroup <= 0.1) {
|
if (testGroup <= 0.25) {
|
||||||
user._ABtests.dropCapNotif = 'drop-cap-notif-enabled';
|
user._ABtests.dropCapNotif = 'drop-cap-notif-enabled';
|
||||||
} else if (testGroup <= 0.2) {
|
} else if (testGroup <= 0.5) {
|
||||||
user._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
|
user._ABtests.dropCapNotif = 'drop-cap-notif-disabled';
|
||||||
} else {
|
} else {
|
||||||
user._ABtests.dropCapNotif = 'drop-cap-notif-not-enrolled';
|
user._ABtests.dropCapNotif = 'drop-cap-notif-not-enrolled';
|
||||||
|
|||||||
Reference in New Issue
Block a user