WIP. Accepting a redundant party invite will not remove the user from the party and let the user still be a part of it. Fixes #12291. (#12356)

* Getting the latest code

* Temporary fix for Redundant Party Invite. Needs changes.

* Added logic to check if the user is an existing member of the party that the user is invited to.

* Added a test case for redundant party invite check.

* Changed the test case for redundant party invite to see if it runs successfully.

* Made changes to the test cases.

* Fixed lint errors.

* Removed the exclusive mocha test.

* Referred the issue in the name of the new test case.

* Modified test case to check its veracity.

* Checking if the update statement is working or not.
This commit is contained in:
Jalansh
2020-07-13 19:30:34 +05:30
committed by GitHub
parent 616a0b7509
commit a02c4c1cfd
2 changed files with 23 additions and 10 deletions

View File

@@ -203,6 +203,16 @@ describe('POST /group/:groupId/join', () => {
await expect(invitedUser.get('/user')).to.eventually.have.nested.property('party._id', party._id);
});
it('Issue #12291: accepting a redundant party invite will let the user stay in the party', async () => {
await invitedUser.update({
'party._id': party._id,
});
await expect(invitedUser.get('/user')).to.eventually.have.nested.property('party._id', party._id);
await invitedUser.post(`/groups/${party._id}/join`);
await expect(invitedUser.get('/user')).to.eventually.have.nested.property('party._id', party._id);
});
it('notifies inviting user that their invitation was accepted', async () => {
await invitedUser.post(`/groups/${party._id}/join`);