mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Send back flag data if user had flagged the message.
This commit is contained in:
@@ -39,6 +39,17 @@ describe('POST /groups/:id/chat/:id/flag', () => {
|
||||
expect(message.flagCount).to.eql(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('cannot flag the same message twice', () => {
|
||||
let api = requester(user);
|
||||
|
||||
return expect(api.post(`/groups/${group._id}/chat/${message.id}/flag`).then((messages) => {
|
||||
return api.post(`/groups/${group._id}/chat/${message.id}/flag`);
|
||||
})).to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
text: t('messageGroupChatFlagAlreadyReported'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
context('own message', () => {
|
||||
|
||||
Reference in New Issue
Block a user