mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 09:39:23 +00:00
Merge branch 'release' into develop
This commit is contained in:
commit
05ea2c1ce6
4 changed files with 22 additions and 2 deletions
2
npm-shrinkwrap.json
generated
2
npm-shrinkwrap.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "habitica",
|
"name": "habitica",
|
||||||
"version": "3.93.0",
|
"version": "3.93.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gulp-sourcemaps/map-sources": {
|
"@gulp-sourcemaps/map-sources": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|
|
||||||
|
|
@ -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": "3.93.0",
|
"version": "3.93.1",
|
||||||
"main": "./website/server/index.js",
|
"main": "./website/server/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@slack/client": "^3.8.1",
|
"@slack/client": "^3.8.1",
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,25 @@ describe('shouldDo', () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('returns false and ignore malformed repeat object', () => {
|
||||||
|
dailyTask.repeat = {
|
||||||
|
su: false,
|
||||||
|
s: false,
|
||||||
|
f: false,
|
||||||
|
th: false,
|
||||||
|
w: false,
|
||||||
|
t: false,
|
||||||
|
m: false,
|
||||||
|
errors: 'errors',
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let weekday of [0, 1, 2, 3, 4, 5, 6]) {
|
||||||
|
day = moment().day(weekday).toDate();
|
||||||
|
|
||||||
|
expect(shouldDo(day, dailyTask, options)).to.equal(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it('returns false if day of the week does not match and active on the day it matches', () => {
|
it('returns false if day of the week does not match and active on the day it matches', () => {
|
||||||
dailyTask.repeat = {
|
dailyTask.repeat = {
|
||||||
su: false,
|
su: false,
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ export function shouldDo (day, dailyTask, options = {}) {
|
||||||
|
|
||||||
if (dailyTask.repeat) {
|
if (dailyTask.repeat) {
|
||||||
for (let [repeatDay, active] of Object.entries(dailyTask.repeat)) {
|
for (let [repeatDay, active] of Object.entries(dailyTask.repeat)) {
|
||||||
|
if (!isFinite(DAY_MAPPING_STRING_TO_NUMBER[repeatDay])) continue; // eslint-disable-line no-continue
|
||||||
if (active) daysOfTheWeek.push(parseInt(DAY_MAPPING_STRING_TO_NUMBER[repeatDay], 10));
|
if (active) daysOfTheWeek.push(parseInt(DAY_MAPPING_STRING_TO_NUMBER[repeatDay], 10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue