[Enhancement] Format messages in widget (#268)

* Use message formatter in widget

* Rename the variable
This commit is contained in:
Pranav Raj S 2019-11-24 00:29:55 +05:30 committed by Sony Mathew
parent c96e2c334c
commit c6feea9f6d
6 changed files with 66 additions and 17 deletions

View file

@ -0,0 +1,13 @@
import MessageFormatter from '../MessageFormatter';
describe('#MessageFormatter', () => {
describe('content with links', () => {
it('should format correctly', () => {
const message =
'Chatwoot is an opensource tool\nSee more at https://www.chatwoot.com';
expect(new MessageFormatter(message).formattedMessage).toEqual(
'Chatwoot is an opensource tool<br>See more at <a href="https://www.chatwoot.com" target="_blank">https://www.chatwoot.com</a>'
);
});
});
});