mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +00:00
rename files to suit Jest
This commit is contained in:
74
tests/lib/markdown.test.js
Normal file
74
tests/lib/markdown.test.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import Markdown from 'browser/lib/markdown'
|
||||
import markdownFixtures from '../fixtures/markdowns'
|
||||
|
||||
// basic markdown instance which meant to be used in every test cases.
|
||||
// To test markdown options, initialize a new instance in your test case
|
||||
const md = new Markdown()
|
||||
|
||||
test('Markdown.render() should renders markdown correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.basic)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders codeblock correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.codeblock)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders KaTeX correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.katex)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders checkboxes', () => {
|
||||
const rendered = md.render(markdownFixtures.checkboxes)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should text with quotes correctly', () => {
|
||||
const renderedSmartQuotes = md.render(markdownFixtures.smartQuotes)
|
||||
expect(renderedSmartQuotes).toMatchSnapshot()
|
||||
|
||||
const newmd = new Markdown({ typographer: false })
|
||||
const renderedNonSmartQuotes = newmd.render(markdownFixtures.smartQuotes)
|
||||
expect(renderedNonSmartQuotes).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should render line breaks correctly', () => {
|
||||
const renderedBreaks = md.render(markdownFixtures.breaks)
|
||||
expect(renderedBreaks).toMatchSnapshot()
|
||||
|
||||
const newmd = new Markdown({ breaks: false })
|
||||
const renderedNonBreaks = newmd.render(markdownFixtures.breaks)
|
||||
expect(renderedNonBreaks).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders abbrevations correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.abbrevations)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders sub correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.subTexts)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders sup correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.supTexts)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should renders definition lists correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.deflists)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should render shortcuts correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.shortcuts)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Markdown.render() should render footnote correctly', () => {
|
||||
const rendered = md.render(markdownFixtures.footnote)
|
||||
expect(rendered).toMatchSnapshot()
|
||||
})
|
||||
Reference in New Issue
Block a user