Tasks score notes (#8507)

* Added setting and modal for score notes

* Added persistent score notes

* Fixed linting issues and documented new field

* Added max length to task score notes

* Added check for score notes existence

* Combined tasks perferences
This commit is contained in:
Keith Holliday
2017-02-27 14:56:34 -07:00
committed by GitHub
parent 68a042cdb9
commit 93befcebcc
12 changed files with 102 additions and 9 deletions

View File

@@ -212,6 +212,15 @@ describe('shared.ops.scoreTask', () => {
expect(ref.afterUser.stats.gp).to.be.greaterThan(ref.beforeUser.stats.gp);
});
it('adds score notes', () => {
let scoreNotesString = 'scoreNotes';
habit.scoreNotes = scoreNotesString;
options = { user: ref.afterUser, task: habit, direction: 'up', times: 5, cron: false };
scoreTask(options);
expect(habit.history[0].scoreNotes).to.eql(scoreNotesString);
});
it('down', () => {
scoreTask({user: ref.afterUser, task: habit, direction: 'down', times: 5, cron: false}, {});