Improvements and fixes for push notifications (#11507)
* Strip markdown from push notifications
* Revert "Strip markdown from push notifications"
This reverts commit 4741e584c6.
* correctly set type for mention push notifications
* Add unformattedText field to chat messages
* fiix lint errors
* Add check that markdown formatting is stripped from messages
* Add check for markdown formatting in messages.
This commit is contained in:
committed by
Matteo Pagliazzi
parent
3c394e7448
commit
b108b047cd
@@ -1317,7 +1317,7 @@ describe('Group Model', () => {
|
||||
|
||||
it('formats message', () => {
|
||||
const chatMessage = party.sendChat({
|
||||
message: 'a new message',
|
||||
message: 'a _new_ message with *markdown*',
|
||||
user: {
|
||||
_id: 'user-id',
|
||||
profile: { name: 'user name' },
|
||||
@@ -1336,7 +1336,8 @@ describe('Group Model', () => {
|
||||
|
||||
const chat = chatMessage;
|
||||
|
||||
expect(chat.text).to.eql('a new message');
|
||||
expect(chat.text).to.eql('a _new_ message with *markdown*');
|
||||
expect(chat.unformattedText).to.eql('a new message with markdown');
|
||||
expect(validator.isUUID(chat.id)).to.eql(true);
|
||||
expect(chat.timestamp).to.be.a('date');
|
||||
expect(chat.likes).to.eql({});
|
||||
|
||||
@@ -6,7 +6,8 @@ import {
|
||||
|
||||
describe('POST /members/send-private-message', () => {
|
||||
let userToSendMessage;
|
||||
const messageToSend = 'Test Private Message';
|
||||
const messageToSend = 'Test *Private* Message';
|
||||
const unformattedMessage = 'Test Private Message';
|
||||
|
||||
beforeEach(async () => {
|
||||
userToSendMessage = await generateUser();
|
||||
@@ -110,7 +111,9 @@ describe('POST /members/send-private-message', () => {
|
||||
|
||||
const sendersMessageInReceiversInbox = _.find(
|
||||
updatedReceiver.inbox.messages,
|
||||
message => message.uuid === userToSendMessage._id && message.text === messageToSend,
|
||||
message => message.uuid === userToSendMessage._id
|
||||
&& message.text === messageToSend
|
||||
&& message.unformattedText === unformattedMessage,
|
||||
);
|
||||
|
||||
const sendersMessageInSendersInbox = _.find(
|
||||
|
||||
Reference in New Issue
Block a user