mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
557 B
TypeScript
18 lines
557 B
TypeScript
import { bbcodeToPlainText } from '../serialize';
|
|
|
|
describe('bbcodeToPlainText should be ok', () => {
|
|
test.each([
|
|
['normal', 'normal'],
|
|
['with space', 'with space'],
|
|
['image [img]http://image.url[/img]', 'image [图片]'],
|
|
['url [url]http://link.url[/url]', 'url http://link.url'],
|
|
['url2 [url=http://baidu.com]a[/url]', 'url2 a'],
|
|
['at [at=uuid]name[/at]', 'at @name'],
|
|
['[emoji]smile[/emoji]', ':smile:'],
|
|
])('%s', (input, output) => {
|
|
const plain = bbcodeToPlainText(input);
|
|
|
|
expect(output).toBe(plain);
|
|
});
|
|
});
|