/* * Squidex Headless CMS * * @license * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ import { MarkdownPipe } from './markdown.pipe'; describe('MarkdownPipe', () => { it('should convert link to html', () => { const actual = new MarkdownPipe().transform('[link-name](link-url)'); expect(actual).toBe('

link-name

\n'); }); it('should convert markdown to html', () => { const actual = new MarkdownPipe().transform('*bold*'); expect(actual).toBe('

bold

\n'); }); [null, undefined, ''].map(x => { it('should return empty string for invalid value', () => { const actual = new MarkdownPipe().transform(x); expect(actual).toBe(''); }); }); });