[Enhancement] Format messages in widget (#268)
* Use message formatter in widget * Rename the variable
This commit is contained in:
parent
c96e2c334c
commit
c6feea9f6d
6 changed files with 66 additions and 17 deletions
13
app/javascript/shared/helpers/specs/MessageFormatter.spec.js
Normal file
13
app/javascript/shared/helpers/specs/MessageFormatter.spec.js
Normal 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>'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue