Mentions Fix and Test (#11475)

* Fix issue with mentioned members not being loaded enough

* mentions: add integration tests and fix saved message
This commit is contained in:
Matteo Pagliazzi
2019-10-24 11:35:15 +02:00
committed by GitHub
parent b121585c68
commit c3a8305a40
4 changed files with 23 additions and 2 deletions

View File

@@ -135,6 +135,17 @@ describe('POST /members/send-private-message', () => {
expect(sendersMessageInSendersInbox).to.exist;
});
it('sends a private message with mentions to a user', async () => {
const receiver = await generateUser();
const response = await userToSendMessage.post('/members/send-private-message', {
message: `hi @${receiver.auth.local.username}`,
toUserId: receiver._id,
});
expect(response.message.text).to.include(`[@${receiver.auth.local.username}](/profile/${receiver._id})`);
});
// @TODO waiting for mobile support
xit('creates a notification with an excerpt if the message is too long', async () => {
const receiver = await generateUser();