mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
[WIP] Group tasks claim (#8099)
* Added initial group tasks ui * Changed group compnent directory * Added group task checklist support * Added checklist support to ui * Fixed delete tags route * Added checklist routes to support new group tasks * Added assign user tag input * Added new group members autocomplete directive * Linked assign ui to api * Added styles * Limited tag use * Fixed line endings * Updated to new file structure * Fixed failing task tests * Updatd with new checklist logic and fixed columns * Updated add task function * Added userid check back to tag routes * Added back routes accidently deleted * Added locale strings * Moved common task function to task service * Removed files from manifest * Added initial group tasks ui * Changed group compnent directory * Added checklist support to ui * Added assign user tag input * Added assign user tag input * Added new group members autocomplete directive * Added new group members autocomplete directive * Removed group get tasks until live * Linked assign ui to api * Added styles * Added server code for claiming a task * ADded group task meta and claim button * Adjusted styles, added local, and added confirm * Updated claim with new file structures * Fixed merge issue * Removed extra file * Removed duplicate functions * Removed extra directive * Removed dev items
This commit is contained in:
committed by
Matteo Pagliazzi
parent
826d7b85d7
commit
ff08e8b586
@@ -74,7 +74,7 @@ describe('POST /tasks/:taskId', () => {
|
||||
});
|
||||
|
||||
it('returns error when non leader tries to create a task', async () => {
|
||||
await expect(member.post(`/tasks/${task._id}/assign/${member._id}`))
|
||||
await expect(member2.post(`/tasks/${task._id}/assign/${member._id}`))
|
||||
.to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
@@ -82,6 +82,17 @@ describe('POST /tasks/:taskId', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('allows user to assign themselves', async () => {
|
||||
await member.post(`/tasks/${task._id}/assign/${member._id}`);
|
||||
|
||||
let groupTask = await user.get(`/tasks/group/${guild._id}`);
|
||||
let memberTasks = await member.get('/tasks/user');
|
||||
let syncedTask = find(memberTasks, findAssignedTask);
|
||||
|
||||
expect(groupTask[0].group.assignedUsers).to.contain(member._id);
|
||||
expect(syncedTask).to.exist;
|
||||
});
|
||||
|
||||
it('assigns a task to a user', async () => {
|
||||
await user.post(`/tasks/${task._id}/assign/${member._id}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user