mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user