Feature - Store Exact Completion Date For Dailies (#9813)

* dailies history date added in scoreTask instead of cron

* fix lint issues

* changes based on feedback. Undo cron code deletion and deleted iteration on scoreTask

* fix lint issues

* add task history entry in cron for dailies that weren't completed

* add history entry after value is fully evaluated
This commit is contained in:
Lula Villalobos
2018-02-05 10:42:20 -08:00
committed by Matteo Pagliazzi
parent fbacb56700
commit a61d911c48
3 changed files with 22 additions and 5 deletions

View File

@@ -291,11 +291,14 @@ describe('shared.ops.scoreTask', () => {
scoreTask({user: ref.afterUser, task: daily, direction: 'up'});
expectGainedPoints(ref.beforeUser, ref.afterUser, freshDaily, daily);
expect(daily.completed).to.eql(true);
expect(daily.history.length).to.eql(1);
});
it('up, down', () => {
scoreTask({user: ref.afterUser, task: daily, direction: 'up'});
expect(daily.history.length).to.eql(1);
scoreTask({user: ref.afterUser, task: daily, direction: 'down'});
expect(daily.history.length).to.eql(0);
expectClosePoints(ref.beforeUser, ref.afterUser, freshDaily, daily);
});