|
|
|
|
@ -13,7 +13,7 @@ describe("Search", () => {
|
|
|
|
|
becca.reset();
|
|
|
|
|
|
|
|
|
|
rootNote = new NoteBuilder(new Note({noteId: 'root', title: 'root', type: 'text'}));
|
|
|
|
|
new Branch(becca, {branchId: 'root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
|
|
|
|
new Branch({branchId: 'root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("simple path match", () => {
|
|
|
|
|
@ -169,7 +169,7 @@ describe("Search", () => {
|
|
|
|
|
.label('established', '1993-01-01'))
|
|
|
|
|
.child(note("Hungary")
|
|
|
|
|
.label('established', '1920-06-04'))
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const searchContext = new SearchContext();
|
|
|
|
|
|
|
|
|
|
@ -218,7 +218,7 @@ describe("Search", () => {
|
|
|
|
|
test("#month = month", 1);
|
|
|
|
|
test("#month = 'MONTH'", 0);
|
|
|
|
|
|
|
|
|
|
test("note.dateCreated =* month", 1);
|
|
|
|
|
test("note.dateCreated =* month", 2);
|
|
|
|
|
|
|
|
|
|
test("#date = TODAY", 1);
|
|
|
|
|
test("#date = today", 1);
|
|
|
|
|
@ -337,11 +337,11 @@ describe("Search", () => {
|
|
|
|
|
|
|
|
|
|
const searchContext = new SearchContext();
|
|
|
|
|
|
|
|
|
|
let searchResults = searchService.findResultsWithQuery('#city AND note.getAncestors().title = Europe', searchContext);
|
|
|
|
|
let searchResults = searchService.findResultsWithQuery('#city AND note.ancestors.title = Europe', searchContext);
|
|
|
|
|
expect(searchResults.length).toEqual(1);
|
|
|
|
|
expect(findNoteByTitle(searchResults, "Prague")).toBeTruthy();
|
|
|
|
|
|
|
|
|
|
searchResults = searchService.findResultsWithQuery('#city AND note.getAncestors().title = Asia', searchContext);
|
|
|
|
|
searchResults = searchService.findResultsWithQuery('#city AND note.ancestors.title = Asia', searchContext);
|
|
|
|
|
expect(searchResults.length).toEqual(1);
|
|
|
|
|
expect(findNoteByTitle(searchResults, "Taipei")).toBeTruthy();
|
|
|
|
|
});
|
|
|
|
|
|