/*global describe, it, expect, example, before, after, beforeEach, afterEach, mocha, sinon*/
'use strict';
var assert = require('chai').assert;
var mdOld = require('js/markdown').old;


// Add sinon asserts to chai.assert, so we can do assert.calledWith instead of sinon.assert.calledWith
sinon.assert.expose(assert, {prefix: ''});

describe('oldMarkdown', () => {

    describe('orderedList', () => {

        it('returns a numbered list', () => {
            var text = '1. hello\n2. there';

            var rendered = mdOld.render(text);

            var html = '<ol>\n<li>hello</li><li>there</li></ol>';
            assert.equal(rendered, html);
        });
    });
    describe('orderedListChangeSymbols', () => {

        it('returns a numbered list even when the symbols change', () => {
            var text = '1. hello \n 2. there \n * friend';

            var rendered = mdOld.render(text);

            var html = '<ol>\n<li>hello</li><li>there</li><li>friend</li></ol>';
            assert.equal(rendered, html);
        });

    });
    describe('listNoSpace', () => {

        it('returns a paragraph because there is not a blank line before list starts', () => {
            var text = 'This Should Not Render\n1. hello \n 2. there \n * friend';

            var rendered = mdOld.render(text);

            var html = '<p>1. hello 2. there * friend</p>';
            assert.equal(rendered, html);
        });

    });
});

@@ -572,32 +572,34 @@
 %5Cn%3Cli%3Ehello%3C/li%3E
+%5Cn
 %3Cli%3Ethere%3C/li%3E%3C/
@@ -592,29 +592,33 @@
 i%3Ethere%3C/li%3E
+%5Cn
 %3C/ol%3E
+%5Cn
 ';%0A         
@@ -943,24 +943,26 @@
 i%3Ehello%3C/li%3E
+%5Cn
 %3Cli%3Ethere%3C/l
@@ -963,16 +963,18 @@
 ere%3C/li%3E
+%5Cn
 %3Cli%3Efrie
@@ -980,21 +980,25 @@
 end%3C/li%3E
+%5Cn
 %3C/ol%3E
+%5Cn
 ';%0A     
@@ -1215,30 +1215,34 @@
  = '
-This Should Not Render
+Not a list but a paragraph
 %5Cn1.
@@ -1243,36 +1243,34 @@
 ph%5Cn1. hello
- 
 %5Cn
- 
 2. there
  %5Cn * friend
@@ -1249,36 +1249,34 @@
  hello%5Cn2. there
- 
 %5Cn
- 
 * friend';%0A%0A    
@@ -1346,24 +1346,52 @@
 l = '%3Cp%3E
+Not a list but a paragraph%5Cn
 1. hello
  2. ther
@@ -1382,25 +1382,26 @@
 1. hello
- 
+%5Cn
 2. there
  * frien
@@ -1392,17 +1392,18 @@
 2. there
- 
+%5Cn
 * friend
@@ -1406,16 +1406,18 @@
 iend%3C/p%3E
+%5Cn
 ';%0A     

Fix JS old markdown test assertions