Files
habitica/test/client/unit/specs/store/getters/tasks/canDelete.js
negue 362ca73c94 raise coverage for tasks api calls (#10029)
* - updates a group task - approval is required
- updates a group task with checklist

* add expect to test the new checklist length

* - moves tasks to a specified position out of length

* remove unused line

* website getter tasks tests

* re-add sanitizeUserChallengeTask

* change config.json.example variable to be a string not a boolean

* fix tests - pick the text / up/down props too

* fix test - remove changes on text/up/down - revert sanitize condition - revert sanitization props
2018-10-01 13:29:14 +02:00

20 lines
521 B
JavaScript

import generateStore from 'client/store';
describe('canDelete getter', () => {
it('cannot delete active challenge task', () => {
const store = generateStore();
const task = {userId: 1, challenge: {id: 2}};
expect(store.getters['tasks:canDelete'](task)).to.equal(false);
});
it('can delete broken challenge task', () => {
const store = generateStore();
const task = {userId: 1, challenge: {id: 2, broken: true}};
expect(store.getters['tasks:canDelete'](task)).to.equal(true);
});
});