From 4f53e39f8d5e1968d503cd44bf77b0ef285758c2 Mon Sep 17 00:00:00 2001 From: antelle Date: Sat, 21 Mar 2020 11:45:40 +0100 Subject: [PATCH] md-to-html test --- test/src/formatting/md-to-html.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/src/formatting/md-to-html.js diff --git a/test/src/formatting/md-to-html.js b/test/src/formatting/md-to-html.js new file mode 100644 index 00000000..28bea140 --- /dev/null +++ b/test/src/formatting/md-to-html.js @@ -0,0 +1,22 @@ +import { expect } from 'chai'; +import { MdToHtml } from 'util/formatting/md-to-html'; + +describe('MdToHtml', () => { + it('should convert markdown', () => { + expect(MdToHtml.convert('## head\n_italic_')).to.eql( + '

head

\n

italic

\n
' + ); + }); + + it('should not add markdown wrapper tags for plaintext', () => { + expect(MdToHtml.convert('plain\ntext')).to.eql('plain\ntext'); + }); + + it('should convert links', () => { + expect(MdToHtml.convert('[link](https://x)')).to.eql( + '
' + + '

link

\n' + + '
' + ); + }); +});