tagHandler - Handle code tag as code block + test

This commit is contained in:
2019-12-22 03:32:49 +05:30
parent 3a279e9710
commit 4b9bfffbb5
2 changed files with 44 additions and 1 deletions
+16
View File
@@ -175,3 +175,19 @@ test('should render blockquote with mixed text', () => {
) as string).trim()
).toBe('> This is _hello_ **world**');
});
test('should render code tag with text', () => {
expect(
(render(
<code lang="js">const a = 1;</code>
) as string).trim()
).toBe('```js\nconst a = 1;\n```');
});
test('should render code tag without text', () => {
expect(
(render(
<code lang="js"/>
) as string).trim()
).toBe('```js\n\n```');
});