verdnatura-chat/app/containers/markdown/formatText.test.ts

21 lines
651 B
TypeScript
Raw Normal View History

2022-02-28 18:00:47 +00:00
import { formatText } from './formatText';
describe('FormatText', () => {
test('empty to be empty', () => {
expect(formatText('')).toBe('');
});
test('A123 to be A123', () => {
expect(formatText('A123')).toBe('A123');
});
test('Format <http://link|Text> to be [Text](http://link)', () => {
expect(formatText('<http://link|Text>')).toBe('[Text](http://link)');
});
test('render test (arabic)', () => {
expect(formatText('اختبا <http://link|ر123>')).toBe('اختبا [ر123](http://link)');
});
test('render test (russian)', () => {
expect(formatText('<http://link|тест123>')).toBe('[тест123](http://link)');
});
});