The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/message-parser/tests/image.test.ts

19 lines
527 B

import { parse } from '../src';
import { image, paragraph, plain } from '../src/utils';
test.each([
[
'![image](https://rocket.chat/assets/img/header/logo.svg)',
[
paragraph([
image('https://rocket.chat/assets/img/header/logo.svg', plain('image')),
]),
],
],
[
'![](https://rocket.chat/assets/img/header/logo.svg)',
[paragraph([image('https://rocket.chat/assets/img/header/logo.svg')])],
],
])('parses %p', (input, output) => {
expect(parse(input)).toMatchObject(output);
});