diff --git a/test/api/v3/integration/user/POST-user_class_cast_spellId.test.js b/test/api/v3/integration/user/POST-user_class_cast_spellId.test.js index ccad5c24e8..3793e789dd 100644 --- a/test/api/v3/integration/user/POST-user_class_cast_spellId.test.js +++ b/test/api/v3/integration/user/POST-user_class_cast_spellId.test.js @@ -2,6 +2,7 @@ import { generateUser, translate as t, createAndPopulateGroup, + generateGroup, generateChallenge, sleep, } from '../../../../helpers/api-integration/v3'; @@ -186,6 +187,40 @@ describe('POST /user/class/cast/:spellId', () => { expect(group.chat[0].uuid).to.equal('system'); }); + it('searing brightness does not affect challenge or group tasks', async () => { + let guild = await generateGroup(user); + let challenge = await generateChallenge(user, guild); + await user.post(`/tasks/challenge/${challenge._id}`, { + text: 'test challenge habit', + type: 'habit', + }); + + let groupTask = await user.post(`/tasks/group/${guild._id}`, { + text: 'todo group', + type: 'todo', + }); + await user.update({'stats.class': 'healer', 'stats.mp': 200, 'stats.lvl': 15}); + await user.post(`/tasks/${groupTask._id}/assign/${user._id}`); + + await user.post('/user/class/cast/brightness'); + await user.sync(); + + let memberTasks = await user.get('/tasks/user'); + + let syncedGroupTask = find(memberTasks, function findAssignedTask (memberTask) { + return memberTask.group.id === guild._id; + }); + + let userChallengeTask = find(memberTasks, function findAssignedTask (memberTask) { + return memberTask.challenge.id === challenge._id; + }); + + expect(userChallengeTask).to.exist; + expect(syncedGroupTask).to.exist; + expect(userChallengeTask.value).to.equal(0); + expect(syncedGroupTask.value).to.equal(0); + }); + // TODO find a way to have sinon working in integration tests // it doesn't work when tests are running separately from server it('passes correct target to spell when targetType === \'task\'');