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/blockquotes.test.ts

40 lines
790 B

import { parse } from '../src';
import { paragraph, plain, quote, bold } from '../src/utils';
test.each([
[
`
As Rocket Cat said:
> meowww
> grr.
`.trim(),
[
paragraph([plain('As Rocket Cat said:')]),
quote([paragraph([plain('meowww')]), paragraph([plain('grr.')])]),
],
],
[
`
As Rocket Cat said:
> *meowww*
> grr.
`.trim(),
[
paragraph([plain('As Rocket Cat said:')]),
quote([paragraph([bold([plain('meowww')])]), paragraph([plain('grr.')])]),
],
],
[
`
As Rocket Cat said:
>meowww
>grr.
`.trim(),
[
paragraph([plain('As Rocket Cat said:')]),
quote([paragraph([plain('meowww')]), paragraph([plain('grr.')])]),
],
],
])('parses %p', (input, output) => {
expect(parse(input)).toMatchObject(output);
});