Refactor and add tests to flagged messages.
This commit is contained in:
@@ -197,7 +197,7 @@ describe('GET /groups/:id', () => {
|
||||
});
|
||||
});
|
||||
|
||||
xit('TODO: Not yet implimented - includes user ids in flags object', () => {
|
||||
it('includes user ids in flags object', () => {
|
||||
return api.get(`/groups/${group._id}`).then((_group) => {
|
||||
let chatWithOneFlag = _group.chat[2];
|
||||
expect(chatWithOneFlag.id).to.eql(chat3.id);
|
||||
|
||||
@@ -36,7 +36,7 @@ describe('POST /groups/:id/chat/:id/flag', () => {
|
||||
return api.get(`/groups/${group._id}/chat`);
|
||||
}).then((messages) => {
|
||||
let message = messages[0];
|
||||
expect(message.flags[user._id]).to.eql(true);
|
||||
expect(message.flagCount).to.eql(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user