mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
* Added check - user can't block himself * removed exclusive test
This commit is contained in:
committed by
Sabe Jones
parent
444f393f3a
commit
15626b8ae1
@@ -25,6 +25,15 @@ describe('shared.ops.blockUser', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it('validates user can\'t block himself', (done) => {
|
||||
try {
|
||||
blockUser(user, { params: { uuid: user._id } });
|
||||
} catch (error) {
|
||||
expect(error.message).to.eql(i18n.t('blockYourself'));
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it('blocks user', () => {
|
||||
let [result] = blockUser(user, { params: { uuid: blockedUser._id } });
|
||||
expect(user.inbox.blocks).to.eql([blockedUser._id]);
|
||||
|
||||
Reference in New Issue
Block a user