mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
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:
@@ -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`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user