diff --git a/package.json b/package.json index 39491d967..5c0756fe4 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "test:coverage": "jest --coverage --silent --runInBand", "test:dev": "jest --verbose --watch", "test:basic": "jest tests/markdown/basic.test.js --verbose", + "test:mustache-syntax": "jest '.*(mustache-syntax).*' --verbose --noStackTrace", "test:mustache-syntax:inline": "jest '.*(mustache-syntax).*' -t '^Inline:.*' --verbose --noStackTrace", "test:mustache-syntax:block": "jest '.*(mustache-syntax).*' -t '^Block:.*' --verbose --noStackTrace", "test:mustache-syntax:injection": "jest '.*(mustache-syntax).*' -t '^Injection:.*' --verbose --noStackTrace", diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index f4e2f33d3..f75ce746a 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -13,95 +13,109 @@ String.prototype.trimReturns = function(){ // Remove the `.failing()` method once you have fixed the issue. describe('Inline: When using the Inline syntax {{ }}', ()=>{ - it('Renders a mustache span with text only', function() { + it.failing('Renders a mustache span with text only', function() { const source = '{{ text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text only, but with spaces', function() { + it.failing('Renders a mustache span with text only, but with spaces', function() { const source = '{{ this is a text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('this is a text'); }); - it('Renders an empty mustache span', function() { + it.failing('Renders an empty mustache span', function() { const source = '{{}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it('Renders a mustache span with just a space', function() { + it.failing('Renders a mustache span with just a space', function() { const source = '{{ }}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it('Renders a mustache span with a few spaces only', function() { + it.failing('Renders a mustache span with a few spaces only', function() { const source = '{{ }}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(''); }); - it('Renders a mustache span with text and class', function() { + it.failing('Renders a mustache span with text and class', function() { const source = '{{my-class text}}'; const rendered = Markdown.render(source); + // FIXME: adds two extra \s before closing `>` in opening tag. expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and two classes', function() { + it.failing('Renders a mustache span with text and two classes', function() { const source = '{{my-class,my-class2 text}}'; const rendered = Markdown.render(source); + // FIXME: adds two extra \s before closing `>` in opening tag. expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text with spaces and class', function() { + it.failing('Renders a mustache span with text with spaces and class', function() { const source = '{{my-class this is a text}}'; const rendered = Markdown.render(source); + // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('this is a text'); }); - it('Renders a mustache span with text and id', function() { + it.failing('Renders a mustache span with text and id', function() { const source = '{{#my-span text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and two ids', function() { + it.failing('Renders a mustache span with text and two ids', function() { const source = '{{#my-span,#my-favorite-span text}}'; const rendered = Markdown.render(source); - // FIXME: do we need to report an error here somehow? + // FIXME: adds extra \s before closing `>` in opening tag, and another after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and css property', function() { + it.failing('Renders a mustache span with text and css property', function() { const source = '{{color:red text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and two css properties', function() { + it.failing('Renders a mustache span with text and two css properties', function() { const source = '{{color:red,padding:5px text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and css property which contains quotes', function() { + it.failing('Renders a mustache span with text and css property which contains quotes', function() { const source = '{{font-family:"trebuchet ms" text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text and two css properties which contains quotes', function() { + it.failing('Renders a mustache span with text and two css properties which contains quotes', function() { const source = '{{font-family:"trebuchet ms",padding:"5px 10px" text}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text'); }); - it('Renders a mustache span with text with quotes and css property which contains quotes', function() { + it.failing('Renders a mustache span with text with quotes and css property which contains quotes', function() { const source = '{{font-family:"trebuchet ms" text "with quotes"}}'; const rendered = Markdown.render(source); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }, `Input:\n${source}`, { showPrefix: false }).toBe('text “with quotes”'); }); @@ -115,19 +129,21 @@ describe('Inline: When using the Inline syntax {{ }}', ()=>{ // BLOCK SYNTAX describe(`Block: When using the Block syntax {{tags\\ntext\\n}}`, ()=>{ - it('Renders a div with text only', function() { + it.failing('Renders a div with text only', function() { const source = dedent`{{ text }}`; const rendered = Markdown.render(source).trimReturns(); + // FIXME: adds extra \s after class names expect(rendered, `Input:\n${source}`, { showPrefix: false }, `Input:\n${source}`, { showPrefix: false }).toBe(`
text
{{}}
`); }); - it('Renders a div with a single class', function() { + it.failing('Renders a div with a single class', function() { const source = dedent`{{cat }}`; const rendered = Markdown.render(source).trimReturns(); + // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }, `Input:\n${source}`, { showPrefix: false }).toBe(``); }); - it('Renders a div with a single class and text', function() { + it.failing('Renders a div with a single class and text', function() { const source = dedent`{{cat Sample text. }}`; const rendered = Markdown.render(source).trimReturns(); + // FIXME: adds two extra \s before closing `>` in opening tag expect(rendered, `Input:\n${source}`, { showPrefix: false }, `Input:\n${source}`, { showPrefix: false }).toBe(`Sample text.
Sample text.
Sample text.
Sample text.
Sample text.
Sample text.
Sample text.
emphasis
'); }); - it('Renders a code element with injected style', function() { + it.failing('Renders a code element with injected style', function() { const source = '`code`{background:gray}'; const rendered = Markdown.render(source).trimReturns(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('code

text{background:blue}
'); @@ -250,25 +273,25 @@ describe('Injection: When an injection tag follows an element', ()=>{ }); describe('and that element is a block', ()=>{ - it('renders a div "text" with no injection', function() { + it.failing('renders a div "text" with no injection', function() { const source = '{{\ntext\n}}\n{}'; const rendered = Markdown.render(source).trimReturns(); expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('text
text
text
text
{secondInjection}
'); }); - it('renders a div nested into another div, the inner with class=innerDiv and the other class=outerDiv', function() { + it.failing('renders a div nested into another div, the inner with class=innerDiv and the other class=outerDiv', function() { const source = dedent`{{ outer text {{