const path = require('path')
const {expect} = require('chai')
const {init, expectSameDom} = require('./_helper')
describe('render', function() {
it('important content (tips)', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile('!> **Time** is money, my friend!')
expect(output).equal('
Time is money, my friend!
')
})
describe('lists', function() {
it('as unordered task list', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile(`
- [x] Task 1
- [ ] Task 2
- [ ] Task 3`)
expect(output, ``)
})
it('as ordered task list', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile(`
1. [ ] Task 1
2. [x] Task 2`)
expectSameDom(output, `
`)
})
it('normal unordered', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile(`
- [linktext](link)
- just text`)
expectSameDom(output, ``)
})
it('unordered with custom start', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile(`
1. first
2. second
text
3. third`)
expectSameDom(output, `
- first
- second
text
- third
`)
})
it('nested', async function() {
const {docsify, dom} = await init()
const output = docsify.compiler.compile(`
- 1
- 2
- 2 a
- 2 b
- 3`)
expectSameDom(output, ``)
})
})
})