0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

The remainder of the tests

This commit is contained in:
David Bolack
2024-01-14 13:38:01 -06:00
parent 4c2211c428
commit d09dc11f5f

View File

@@ -21,9 +21,34 @@ describe('Dictionary Terms', ()=>{
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>My term</dt><dd>My First Definition</dd><dd>My Second Definition</dd><dd>My Third Definition</dd>\n</dl>');
});
test('Multiline Definitions', function() {
const source = '**Example** :: V3 uses HTML *definition lists* to create "lists" with hanging indents.\n::Two::\nThree\n::Four\n\n';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt><strong>Example</strong></dt>\n<dd>V3 uses HTML <em>definition lists</em> to create “lists” with hanging indents.</dd>\n<dd>Two</dd\n<dd>Three</dd>\n<dd>Four</dd>\n</dl><dl>');
});
test('Multiple Definition Terms, single line, single definition', function() {
const source = 'Term 1::Definition of Term 1\nTerm 2::Definition of Term 2';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>Term 1</dt><dd>Definition of Term 1</dd><dt>Term 2></dt><dd>Definition of Term 2</dd>\n</dl>');
});
test('Multiple Definition Terms, single line, multiple definitions', function() {
const source = 'Term 1::Definition 1 of Term 1::Definition 2 of Term 1\nTerm 2::Definition 1 of Term 2::Definition 2 of Term 2';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>Term 1</dt><dd>Definition of Term 1</dd><dt>Term 2></dt><dd>Definition of Term 2</dd>\n</dl>');
});
test('Multiple Definition Terms, single definitions, multiple lines', function() {
const source = 'Term 1::Definition 1 of Term 1\n::Definition 2 of Term 1\nTerm 2::Definition of Term 2';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>Term 1</dt><dd>Definition of Term 1</dd><dt>Term 2></dt><dd>Definition of Term 2</dd>\n</dl>');
});
test('Multiple Definition Terms, multiple mixed-line definitions', function() {
const source = 'Term 1::Definition 1 of Term 1\n::Definition 2 of Term 1::Definition 3 of Term 1\nTerm 2::Definition of Term 2';
const rendered = Markdown.render(source);
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<dl><dt>Term 1</dt><dd>Definition of Term 1</dd><dt>Term 2></dt><dd>Definition of Term 2</dd>\n</dl>');
});
});