fixed bug in search where note with inherited attribute is not matched when the owning note is not matched, #2457

This commit is contained in:
zadam
2021-12-20 21:35:12 +01:00
parent b1c4737e78
commit b8eeb0371c
2 changed files with 24 additions and 11 deletions
+15
View File
@@ -157,6 +157,21 @@ describe("Search", () => {
expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
});
it("inherited label comparison", () => {
rootNote
.child(note("Europe")
.label('country', '', true)
.child(note("Austria"))
.child(note("Czech Republic"))
);
const searchContext = new SearchContext();
const searchResults = searchService.findResultsWithQuery('austria #country', searchContext);
expect(searchResults.length).toEqual(1);
expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
});
it("numeric label comparison fallback to string comparison", () => {
// dates should not be coerced into numbers which would then give wrong numbers