mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 04:12:47 +00:00
Add basic tests for Dictionary lists.
This commit is contained in:
24
tests/markdown/marked-extensions.test.js
Normal file
24
tests/markdown/marked-extensions.test.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
const Markdown = require('naturalcrit/markdown.js');
|
||||
|
||||
describe('Dictionary Terms', ()=>{
|
||||
test('Single Definition', function() {
|
||||
const source = 'My term :: My First Definition';
|
||||
const rendered = Markdown.render(source);
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>My term</dt><dd>My First Definition</dd></dl>');
|
||||
});
|
||||
|
||||
test('Two Definitions', function() {
|
||||
const source = 'My term :: My First Definition :: My Second Definition';
|
||||
const rendered = Markdown.render(source);
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>My term</dt><dd>My First Definition</dd>\n<dd>My Second Definition</dd></dl>');
|
||||
});
|
||||
|
||||
test('Three Definitions', function() {
|
||||
const source = 'My term :: My First Definition :: My Second Definition :: My Third Definition';
|
||||
const rendered = Markdown.render(source);
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>My term</dt><dd>My First Definition</dd>\n<dd>My Second Definition</dd>\n<dd>My Third Definition</dd></dl>');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user