Allow Multiple Invites to Party (#8683)

* (server) Add parties array to store invites

* (server) Lint files

* Update joinGroup, rejectGroupInvite, _inviteByUUID, and remove clearPartyInvitation.js

* Update user schema: detailed 'invitations.parties' attributes

* Code improvement and do not let invite twice

* Check if the user is already invited earlier in the code

* Added message to invitation page, and show all invitations

* Added join party confirmation alert

* Small fixes

* Created test: allow inviting a user to 2 different parties

* Updated tests

* Update invitations.parties on more places

* Small adjustments

* Updates on invitations.party references

* Show all invitations when user is already in a party

* Fixed notifications counter

* Update both 'party' and 'parties' at _handleGroupInvitation

* Updated a test

* Fixed small mistake at _handleGroupInvitation

* More test update

* Update invitation.party when removing single invite and small adjust at view
This commit is contained in:
Mateus Etto
2017-07-19 22:45:28 -03:00
committed by Sabe Jones
parent 11a4c1c95d
commit cdc8473f60
17 changed files with 133 additions and 64 deletions

View File

@@ -509,11 +509,9 @@ describe('POST /user/auth/local/register', () => {
confirmPassword: password,
});
expect(user.invitations.party).to.eql({
id: group._id,
name: group.name,
inviter: groupLeader._id,
});
expect(user.invitations.parties[0].id).to.eql(group._id);
expect(user.invitations.parties[0].name).to.eql(group.name);
expect(user.invitations.parties[0].inviter).to.eql(groupLeader._id);
});
it('awards achievement to inviter', async () => {