fulltext now ignores archived notes like it used to in the old implementation

This commit is contained in:
zadam
2020-08-20 00:15:08 +02:00
parent d1f70efdb4
commit 52e0f838a9
7 changed files with 42 additions and 17 deletions

View File

@@ -27,8 +27,9 @@ describe("Parser", () => {
parsingContext: new ParsingContext({includeNoteContent: false})
});
expect(rootExp.constructor.name).toEqual("NoteCacheFlatTextExp");
expect(rootExp.tokens).toEqual(["hello", "hi"]);
expect(rootExp.constructor.name).toEqual("AndExp");
expect(rootExp.subExpressions[0].constructor.name).toEqual("NoteCacheFlatTextExp");
expect(rootExp.subExpressions[0].tokens).toEqual(["hello", "hi"]);
});
it("fulltext parser with content", () => {
@@ -38,8 +39,11 @@ describe("Parser", () => {
parsingContext: new ParsingContext({includeNoteContent: true})
});
expect(rootExp.constructor.name).toEqual("OrExp");
const subs = rootExp.subExpressions;
expect(rootExp.constructor.name).toEqual("AndExp");
expect(rootExp.subExpressions[0].constructor.name).toEqual("OrExp");
expect(rootExp.subExpressions[1].constructor.name).toEqual("PropertyComparisonExp");
const subs = rootExp.subExpressions[0].subExpressions;
expect(subs[0].constructor.name).toEqual("NoteCacheFlatTextExp");
expect(subs[0].tokens).toEqual(["hello", "hi"]);
@@ -149,8 +153,9 @@ describe("Parser", () => {
expect(rootExp.constructor.name).toEqual("AndExp");
const [firstSub, secondSub] = rootExp.subExpressions;
expect(firstSub.constructor.name).toEqual("NoteCacheFlatTextExp");
expect(firstSub.tokens).toEqual(["hello"]);
expect(firstSub.constructor.name).toEqual("AndExp");
expect(firstSub.subExpressions[0].constructor.name).toEqual("NoteCacheFlatTextExp");
expect(firstSub.subExpressions[0].tokens).toEqual(["hello"]);
expect(secondSub.constructor.name).toEqual("LabelComparisonExp");
expect(secondSub.attributeName).toEqual("mylabel");