From 2f3551ef8ed28203a0969a1f80c84a7d6ecda3c8 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 5 May 2020 09:18:17 +0200 Subject: More header tests --- __tests__/index.js | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/__tests__/index.js b/__tests__/index.js index cf61dfa..f300553 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -129,35 +129,54 @@ test('link', t => { }); test('header', t => { - const imageMd = ` + const headerMd= ` Title of the article ==================== {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(headerMd); t.deepEqual(parse(contents), parse('

Title of the article

')); }); test('atx header', t => { - const imageMd = ` + const atxHeaderMd = ` # Title of the article {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(atxHeaderMd); t.deepEqual(parse(contents), parse('

Title of the article

')); }); test('atx header inline', t => { - const imageMd = ` -# Title of the article {data-id="title"} + const atxHeaderMd = ` +# Title of the article {data-id="title"} `; - const {contents} = renderDefault(imageMd); + const {contents} = renderDefault(atxHeaderMd); t.deepEqual(parse(contents), parse('

Title of the article

')); }); +test('atx header inline 2', t => { + const atxHeaderMd = ` +# Title of the article{data-id="title"} + +`; + const {contents} = renderDefault(atxHeaderMd); + t.deepEqual(parse(contents), parse('

Title of the article

')); +}); + +test('header error inline', t => { + const atxHeaderMd = ` +Title of the article {data-id="title"} +====================================== + +`; + const {contents} = renderDefault(atxHeaderMd); + t.deepEqual(parse(contents), parse('

Title of the article {data-id="title"}

')); +}); + test('emphasis and strong', t => { const emphasis = 'Hey ! *That looks cool*{style="color: blue;"} ! No, that\'s **not**{.not} !'; const {contents} = renderDefault(emphasis); -- cgit v1.2.3