mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge branch 'master' into text-deflist
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
exports[`TagListItem renders correctly 1`] = `
|
||||
<div
|
||||
className="tagList-itemContainer"
|
||||
onContextMenu={[Function]}
|
||||
>
|
||||
<div
|
||||
className="tagList-itemNarrow"
|
||||
|
||||
4
tests/fixtures/markdowns.js
vendored
4
tests/fixtures/markdowns.js
vendored
@@ -102,6 +102,7 @@ Term 2 with *inline markup*
|
||||
|
||||
Third paragraph of definition 2.
|
||||
`
|
||||
const shortcuts = '<kbd>Ctrl</kbd>\n\n[[Ctrl]]'
|
||||
|
||||
export default {
|
||||
basic,
|
||||
@@ -113,5 +114,6 @@ export default {
|
||||
abbrevations,
|
||||
subTexts,
|
||||
supTexts,
|
||||
deflists
|
||||
deflists,
|
||||
shortcuts
|
||||
}
|
||||
|
||||
@@ -20,7 +20,47 @@ test('findNoteTitle#find should return a correct title (string)', t => {
|
||||
|
||||
testCases.forEach(testCase => {
|
||||
const [input, expected] = testCase
|
||||
t.is(findNoteTitle(input), expected, `Test for find() input: ${input} expected: ${expected}`)
|
||||
t.is(findNoteTitle(input, false), expected, `Test for find() input: ${input} expected: ${expected}`)
|
||||
})
|
||||
})
|
||||
|
||||
test('findNoteTitle#find should ignore front matter when enableFrontMatterTitle=false', t => {
|
||||
// [input, expected]
|
||||
const testCases = [
|
||||
['---\nlayout: test\ntitle: hoge hoge hoge \n---\n# fuga', '# fuga'],
|
||||
['---\ntitle:hoge\n---\n# fuga', '# fuga'],
|
||||
['title: fuga\n# hoge', '# hoge']
|
||||
]
|
||||
|
||||
testCases.forEach(testCase => {
|
||||
const [input, expected] = testCase
|
||||
t.is(findNoteTitle(input, false), expected, `Test for find() input: ${input} expected: ${expected}`)
|
||||
})
|
||||
})
|
||||
|
||||
test('findNoteTitle#find should respect front matter when enableFrontMatterTitle=true', t => {
|
||||
// [input, expected]
|
||||
const testCases = [
|
||||
['---\nlayout: test\ntitle: hoge hoge hoge \n---\n# fuga', 'hoge hoge hoge'],
|
||||
['---\ntitle:hoge\n---\n# fuga', 'hoge'],
|
||||
['title: fuga\n# hoge', '# hoge']
|
||||
]
|
||||
|
||||
testCases.forEach(testCase => {
|
||||
const [input, expected] = testCase
|
||||
t.is(findNoteTitle(input, true), expected, `Test for find() input: ${input} expected: ${expected}`)
|
||||
})
|
||||
})
|
||||
|
||||
test('findNoteTitle#find should respect frontMatterTitleField when provided', t => {
|
||||
// [input, expected]
|
||||
const testCases = [
|
||||
['---\ntitle: hoge\n---\n# fuga', '# fuga'],
|
||||
['---\ncustom: hoge\n---\n# fuga', 'hoge']
|
||||
]
|
||||
|
||||
testCases.forEach(testCase => {
|
||||
const [input, expected] = testCase
|
||||
t.is(findNoteTitle(input, true, 'custom'), expected, `Test for find() input: ${input} expected: ${expected}`)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -63,3 +63,8 @@ test('Markdown.render() should renders definition lists correctly', t => {
|
||||
const rendered = md.render(markdownFixtures.deflists)
|
||||
t.snapshot(rendered)
|
||||
})
|
||||
|
||||
test('Markdown.render() should render shortcuts correctly', t => {
|
||||
const rendered = md.render(markdownFixtures.shortcuts)
|
||||
t.snapshot(rendered)
|
||||
})
|
||||
|
||||
@@ -18,6 +18,14 @@ Generated by [AVA](https://ava.li).
|
||||
This is the second line.</p>␊
|
||||
`
|
||||
|
||||
## Markdown.render() should render shortcuts correctly
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`<p data-line="0"><kbd>Ctrl</kbd></p>␊
|
||||
<p data-line="2"><kbd>Ctrl</kbd></p>␊
|
||||
`
|
||||
|
||||
## Markdown.render() should renders KaTeX correctly
|
||||
|
||||
> Snapshot 1
|
||||
@@ -48,9 +56,12 @@ Generated by [AVA](https://ava.li).
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
`<pre class="code CodeMirror"><span class="filename">filename.js</span><span class="lineNumber CodeMirror-gutters"><span class="CodeMirror-linenumber">2</span></span><code class="js">var project = 'boostnote';␊
|
||||
</code></pre>␊
|
||||
`
|
||||
`<pre class="code CodeMirror" data-line="1">␊
|
||||
<span class="filename">filename.js</span>␊
|
||||
<span class="lineNumber CodeMirror-gutters"><span class="CodeMirror-linenumber">2</span></span>␊
|
||||
<code class="js">var project = 'boostnote';␊
|
||||
</code>␊
|
||||
</pre>`
|
||||
|
||||
## Markdown.render() should renders definition lists correctly
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user