mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
Fix test
This commit is contained in:
@@ -5,7 +5,7 @@ import _ from 'lodash'
|
|||||||
|
|
||||||
const pickContents = (notes) => notes.map((note) => { return note.content })
|
const pickContents = (notes) => notes.map((note) => { return note.content })
|
||||||
|
|
||||||
let noteList = { noteMap: [] }
|
let notes = []
|
||||||
let note1, note2
|
let note1, note2
|
||||||
|
|
||||||
test.before(t => {
|
test.before(t => {
|
||||||
@@ -14,7 +14,7 @@ test.before(t => {
|
|||||||
note1 = dummyNote(data1)
|
note1 = dummyNote(data1)
|
||||||
note2 = dummyNote(data2)
|
note2 = dummyNote(data2)
|
||||||
|
|
||||||
noteList.noteMap = [note1, note2]
|
notes = [note1, note2]
|
||||||
})
|
})
|
||||||
|
|
||||||
test('it can find notes by tags or words', t => {
|
test('it can find notes by tags or words', t => {
|
||||||
@@ -30,7 +30,7 @@ test('it can find notes by tags or words', t => {
|
|||||||
|
|
||||||
testCases.forEach((testCase) => {
|
testCases.forEach((testCase) => {
|
||||||
const [input, expectedContents] = testCase
|
const [input, expectedContents] = testCase
|
||||||
const results = searchFromNotes(noteList, input)
|
const results = searchFromNotes(notes, input)
|
||||||
t.true(_.isEqual(pickContents(results).sort(), expectedContents.sort()))
|
t.true(_.isEqual(pickContents(results).sort(), expectedContents.sort()))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user