mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
* WIP: #12555 -dayOfMonth takes timezone into account on task update for monthly dailys -startDate set to start of day in user's tz on task update for monthly dailys -tweaked a test so that it's actually testing something * WIP: 12555 -task.startDate gets set to start of day in user's tz on task creation and task update -set preferences.timezoneOffset to nonzero value in certian test user objects -removed date literals in test:api-v3:integration:tasks:PUT
This commit is contained in:
@@ -8,9 +8,14 @@ import {
|
||||
|
||||
describe('POST /tasks/user', () => {
|
||||
let user;
|
||||
let tzoffset;
|
||||
|
||||
before(async () => {
|
||||
tzoffset = new Date().getTimezoneOffset();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
user = await generateUser();
|
||||
user = await generateUser({ 'preferences.timezoneOffset': tzoffset });
|
||||
});
|
||||
|
||||
context('validates params', async () => {
|
||||
@@ -544,7 +549,7 @@ describe('POST /tasks/user', () => {
|
||||
expect(task.everyX).to.eql(5);
|
||||
expect(task.daysOfMonth).to.eql([15]);
|
||||
expect(task.weeksOfMonth).to.eql([3]);
|
||||
expect(new Date(task.startDate)).to.eql(now);
|
||||
expect(new Date(task.startDate)).to.eql(new Date(now.setHours(0, 0, 0, 0)));
|
||||
expect(task.isDue).to.be.true;
|
||||
expect(task.nextDue.length).to.eql(6);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user