mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
10282: Added code for blocking party and guild invitations from block… (#10454)
* 10282: Added code for blocking party and guild invitations from blocked players, added tests * 10282: fixed test label * Update POST-groups_invite.test.js removed `it.only` which was used for testing
This commit is contained in:
committed by
Matteo Pagliazzi
parent
a362914f93
commit
d549fea4ed
@@ -114,6 +114,19 @@ describe('Post /groups/:groupId/invite', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns error when recipient has blocked the senders', async () => {
|
||||
const inviterNoBlocks = await inviter.update({'inbox.blocks': []});
|
||||
let userWithBlockedInviter = await generateUser({'inbox.blocks': [inviter._id]});
|
||||
await expect(inviterNoBlocks.post(`/groups/${group._id}/invite`, {
|
||||
uuids: [userWithBlockedInviter._id],
|
||||
}))
|
||||
.to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('notAuthorizedToSendMessageToThisUser'),
|
||||
});
|
||||
});
|
||||
|
||||
it('invites a user to a group by uuid', async () => {
|
||||
let userToInvite = await generateUser();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user