mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-05 20:39:49 -06:00
more tests & fixes
This commit is contained in:
@@ -492,6 +492,24 @@ describe("Search", () => {
|
||||
expect(noteCache.notes[searchResults[1].noteId].title).toEqual("Ukraine");
|
||||
expect(noteCache.notes[searchResults[2].noteId].title).toEqual("Italy");
|
||||
expect(noteCache.notes[searchResults[3].noteId].title).toEqual("Austria");
|
||||
|
||||
searchResults = await searchService.findNotesWithQuery('# note.parents.title = Europe orderBy note.labels.capital DESC', parsingContext);
|
||||
expect(searchResults.length).toEqual(4);
|
||||
expect(noteCache.notes[searchResults[0].noteId].title).toEqual("Austria");
|
||||
expect(noteCache.notes[searchResults[1].noteId].title).toEqual("Italy");
|
||||
expect(noteCache.notes[searchResults[2].noteId].title).toEqual("Ukraine");
|
||||
expect(noteCache.notes[searchResults[3].noteId].title).toEqual("Slovakia");
|
||||
|
||||
searchResults = await searchService.findNotesWithQuery('# note.parents.title = Europe orderBy note.labels.capital DESC limit 2', parsingContext);
|
||||
expect(searchResults.length).toEqual(2);
|
||||
expect(noteCache.notes[searchResults[0].noteId].title).toEqual("Austria");
|
||||
expect(noteCache.notes[searchResults[1].noteId].title).toEqual("Italy");
|
||||
|
||||
searchResults = await searchService.findNotesWithQuery('# note.parents.title = Europe orderBy #capital DESC limit 0', parsingContext);
|
||||
expect(searchResults.length).toEqual(0);
|
||||
|
||||
searchResults = await searchService.findNotesWithQuery('# note.parents.title = Europe orderBy #capital DESC limit 1000', parsingContext);
|
||||
expect(searchResults.length).toEqual(4);
|
||||
});
|
||||
|
||||
// FIXME: test what happens when we order without any filter criteria
|
||||
|
||||
Reference in New Issue
Block a user