123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663 |
- const searchService = require('../../src/services/search/services/search');
- const BNote = require('../../src/becca/entities/bnote');
- const BBranch = require('../../src/becca/entities/bbranch');
- const SearchContext = require('../../src/services/search/search_context');
- const dateUtils = require('../../src/services/date_utils');
- const becca = require('../../src/becca/becca');
- const {NoteBuilder, findNoteByTitle, note} = require('./becca_mocking');
- describe("Search", () => {
- let rootNote;
- beforeEach(() => {
- becca.reset();
- rootNote = new NoteBuilder(new BNote({noteId: 'root', title: 'root', type: 'text'}));
- new BBranch({branchId: 'none_root', noteId: 'root', parentNoteId: 'none', notePosition: 10});
- });
- it("simple path match", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria"))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('europe austria', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("normal search looks also at attributes", () => {
- const austria = note("Austria");
- const vienna = note("Vienna");
- rootNote
- .child(austria
- .relation('capital', vienna))
- .child(vienna
- .label('inhabitants', '1888776'));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('capital', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('inhabitants', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Vienna")).toBeTruthy();
- });
- it("normal search looks also at type and mime", () => {
- rootNote
- .child(note("Effective Java", {type: 'book', mime:''}))
- .child(note("Hello World.java", {type: 'code', mime: 'text/x-java'}));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('book', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Effective Java")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('text', searchContext); // should match mime
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Hello World.java")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('java', searchContext);
- expect(searchResults.length).toEqual(2);
- });
- it("only end leafs are results", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria"))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('europe', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Europe")).toBeTruthy();
- });
- it("only end leafs are results", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria")
- .label('capital', 'Vienna'))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('Vienna', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("label comparison with short syntax", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria")
- .label('capital', 'Vienna'))
- .child(note("Czech Republic")
- .label('capital', 'Prague'))
- );
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('#capital=Vienna', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- // case sensitivity:
- searchResults = searchService.findResultsWithQuery('#CAPITAL=VIENNA', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('#caPItal=vienNa', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("label comparison with full syntax", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria")
- .label('capital', 'Vienna'))
- .child(note("Czech Republic")
- .label('capital', 'Prague'))
- );
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.labels.capital=Prague', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- });
- it("numeric label comparison", () => {
- rootNote
- .child(note("Europe")
- .label('country', '', true)
- .child(note("Austria")
- .label('population', '8859000'))
- .child(note("Czech Republic")
- .label('population', '10650000'))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('#country #population >= 10000000', searchContext);
- expect(searchResults.length).toEqual(1);
- 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
- rootNote
- .child(note("Europe")
- .label('country', '', true)
- .child(note("Austria")
- .label('established', '1955-07-27'))
- .child(note("Czech Republic")
- .label('established', '1993-01-01'))
- .child(note("Hungary")
- .label('established', '1920-06-04'))
- );
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('#established <= "1955-01-01"', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Hungary")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('#established > "1955-01-01"', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- });
- it("smart date comparisons", () => {
- // dates should not be coerced into numbers which would then give wrong numbers
- rootNote
- .child(note("My note", {dateCreated: dateUtils.localNowDateTime()})
- .label('year', new Date().getFullYear().toString())
- .label('month', dateUtils.localNowDate().substr(0, 7))
- .label('date', dateUtils.localNowDate())
- .label('dateTime', dateUtils.localNowDateTime())
- );
- const searchContext = new SearchContext();
- function test(query, expectedResultCount) {
- const searchResults = searchService.findResultsWithQuery(query, searchContext);
- expect(searchResults.length).toEqual(expectedResultCount);
- if (expectedResultCount === 1) {
- expect(findNoteByTitle(searchResults, "My note")).toBeTruthy();
- }
- }
- test("#year = YEAR", 1);
- test("#year = 'YEAR'", 0);
- test("#year >= YEAR", 1);
- test("#year <= YEAR", 1);
- test("#year < YEAR+1", 1);
- test("#year < YEAR + 1", 1);
- test("#year < year + 1", 1);
- test("#year > YEAR+1", 0);
- test("#month = MONTH", 1);
- test("#month = month", 1);
- test("#month = 'MONTH'", 0);
- test("note.dateCreated =* month", 2);
- test("#date = TODAY", 1);
- test("#date = today", 1);
- test("#date = 'today'", 0);
- test("#date > TODAY", 0);
- test("#date > TODAY-1", 1);
- test("#date > TODAY - 1", 1);
- test("#date < TODAY+1", 1);
- test("#date < TODAY + 1", 1);
- test("#date < 'TODAY + 1'", 1);
- test("#dateTime <= NOW+10", 1);
- test("#dateTime <= NOW + 10", 1);
- test("#dateTime < NOW-10", 0);
- test("#dateTime >= NOW-10", 1);
- test("#dateTime < NOW-10", 0);
- });
- it("logical or", () => {
- rootNote
- .child(note("Europe")
- .label('country', '', true)
- .child(note("Austria")
- .label('languageFamily', 'germanic'))
- .child(note("Czech Republic")
- .label('languageFamily', 'slavic'))
- .child(note("Hungary")
- .label('languageFamily', 'finnougric'))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('#languageFamily = slavic OR #languageFamily = germanic', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("fuzzy attribute search", () => {
- rootNote
- .child(note("Europe")
- .label('country', '', true)
- .child(note("Austria")
- .label('languageFamily', 'germanic'))
- .child(note("Czech Republic")
- .label('languageFamily', 'slavic')));
- let searchContext = new SearchContext({fuzzyAttributeSearch: false});
- let searchResults = searchService.findResultsWithQuery('#language', searchContext);
- expect(searchResults.length).toEqual(0);
- searchResults = searchService.findResultsWithQuery('#languageFamily=ger', searchContext);
- expect(searchResults.length).toEqual(0);
- searchContext = new SearchContext({fuzzyAttributeSearch: true});
- searchResults = searchService.findResultsWithQuery('#language', searchContext);
- expect(searchResults.length).toEqual(2);
- searchResults = searchService.findResultsWithQuery('#languageFamily=ger', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("filter by note property", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria"))
- .child(note("Czech Republic")));
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('# note.title =* czech', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- });
- it("filter by note's parent", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria"))
- .child(note("Czech Republic")
- .child(note("Prague")))
- )
- .child(note("Asia")
- .child(note('Taiwan')));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Asia', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Taiwan")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# note.parents.parents.title = Europe', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Prague")).toBeTruthy();
- });
- it("filter by note's ancestor", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria"))
- .child(note("Czech Republic")
- .child(note("Prague").label('city')))
- )
- .child(note("Asia")
- .child(note('Taiwan')
- .child(note('Taipei').label('city')))
- );
- const searchContext = new 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.ancestors.title = Asia', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Taipei")).toBeTruthy();
- });
- it("filter by note's child", () => {
- rootNote
- .child(note("Europe")
- .child(note("Austria")
- .child(note("Vienna")))
- .child(note("Czech Republic")
- .child(note("Prague"))))
- .child(note("Oceania")
- .child(note('Australia')));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.children.title =* Aust', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(findNoteByTitle(searchResults, "Europe")).toBeTruthy();
- expect(findNoteByTitle(searchResults, "Oceania")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# note.children.title =* Aust AND note.children.title *= republic', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Europe")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# note.children.children.title = Prague', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Europe")).toBeTruthy();
- });
- it("filter by relation's note properties using short syntax", () => {
- const austria = note("Austria");
- const portugal = note("Portugal");
- rootNote
- .child(note("Europe")
- .child(austria)
- .child(note("Czech Republic")
- .relation('neighbor', austria.note))
- .child(portugal)
- .child(note("Spain")
- .relation('neighbor', portugal.note))
- );
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# ~neighbor.title = Austria', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# ~neighbor.title = Portugal', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Spain")).toBeTruthy();
- });
- it("filter by relation's note properties using long syntax", () => {
- const austria = note("Austria");
- const portugal = note("Portugal");
- rootNote
- .child(note("Europe")
- .child(austria)
- .child(note("Czech Republic")
- .relation('neighbor', austria.note))
- .child(portugal)
- .child(note("Spain")
- .relation('neighbor', portugal.note))
- );
- const searchContext = new SearchContext();
- const searchResults = searchService.findResultsWithQuery('# note.relations.neighbor.title = Austria', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- });
- it("filter by multiple level relation", () => {
- const austria = note("Austria");
- const slovakia = note("Slovakia");
- const italy = note("Italy");
- const ukraine = note("Ukraine");
- rootNote
- .child(note("Europe")
- .child(austria
- .relation('neighbor', italy.note)
- .relation('neighbor', slovakia.note))
- .child(note("Czech Republic")
- .relation('neighbor', austria.note)
- .relation('neighbor', slovakia.note))
- .child(slovakia
- .relation('neighbor', ukraine.note))
- .child(ukraine)
- );
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.relations.neighbor.relations.neighbor.title = Italy', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- searchResults = searchService.findResultsWithQuery('# note.relations.neighbor.relations.neighbor.title = Ukraine', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- });
- it("test note properties", () => {
- const austria = note("Austria");
- austria.relation('myself', austria.note);
- austria.label('capital', 'Vienna');
- austria.label('population', '8859000');
- rootNote
- .child(note("Asia"))
- .child(note("Europe")
- .child(austria
- .child(note("Vienna"))
- .child(note("Sebastian Kurz"))
- )
- )
- .child(note("Mozart")
- .child(austria));
- austria.note.isProtected = false;
- austria.note.dateCreated = '2020-05-14 12:11:42.001+0200';
- austria.note.dateModified = '2020-05-14 13:11:42.001+0200';
- austria.note.utcDateCreated = '2020-05-14 10:11:42.001Z';
- austria.note.utcDateModified = '2020-05-14 11:11:42.001Z';
- austria.note.contentLength = 1001;
- const searchContext = new SearchContext();
- function test(propertyName, value, expectedResultCount) {
- const searchResults = searchService.findResultsWithQuery(`# note.${propertyName} = ${value}`, searchContext);
- expect(searchResults.length).toEqual(expectedResultCount);
- }
- test("type", "text", 7);
- test("TYPE", "TEXT", 7);
- test("type", "code", 0);
- test("mime", "text/html", 6);
- test("mime", "application/json", 0);
- test("isProtected", "false", 7);
- test("isProtected", "FALSE", 7);
- test("isProtected", "true", 0);
- test("isProtected", "TRUE", 0);
- test("dateCreated", "'2020-05-14 12:11:42.001+0200'", 1);
- test("dateCreated", "wrong", 0);
- test("dateModified", "'2020-05-14 13:11:42.001+0200'", 1);
- test("dateModified", "wrong", 0);
- test("utcDateCreated", "'2020-05-14 10:11:42.001Z'", 1);
- test("utcDateCreated", "wrong", 0);
- test("utcDateModified", "'2020-05-14 11:11:42.001Z'", 1);
- test("utcDateModified", "wrong", 0);
- test("parentCount", "2", 1);
- test("parentCount", "3", 0);
- test("childrenCount", "2", 1);
- test("childrenCount", "10", 0);
- test("attributeCount", "3", 1);
- test("attributeCount", "4", 0);
- test("labelCount", "2", 1);
- test("labelCount", "3", 0);
- test("relationCount", "1", 1);
- test("relationCount", "2", 0);
- });
- it("test order by", () => {
- const italy = note("Italy").label("capital", "Rome");
- const slovakia = note("Slovakia").label("capital", "Bratislava");
- const austria = note("Austria").label("capital", "Vienna");
- const ukraine = note("Ukraine").label("capital", "Kiev");
- rootNote
- .child(note("Europe")
- .child(ukraine)
- .child(slovakia)
- .child(austria)
- .child(italy));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy note.title', searchContext);
- expect(searchResults.length).toEqual(4);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Austria");
- expect(becca.notes[searchResults[1].noteId].title).toEqual("Italy");
- expect(becca.notes[searchResults[2].noteId].title).toEqual("Slovakia");
- expect(becca.notes[searchResults[3].noteId].title).toEqual("Ukraine");
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy note.labels.capital', searchContext);
- expect(searchResults.length).toEqual(4);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Slovakia");
- expect(becca.notes[searchResults[1].noteId].title).toEqual("Ukraine");
- expect(becca.notes[searchResults[2].noteId].title).toEqual("Italy");
- expect(becca.notes[searchResults[3].noteId].title).toEqual("Austria");
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy note.labels.capital DESC', searchContext);
- expect(searchResults.length).toEqual(4);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Austria");
- expect(becca.notes[searchResults[1].noteId].title).toEqual("Italy");
- expect(becca.notes[searchResults[2].noteId].title).toEqual("Ukraine");
- expect(becca.notes[searchResults[3].noteId].title).toEqual("Slovakia");
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy note.labels.capital DESC limit 2', searchContext);
- expect(searchResults.length).toEqual(2);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Austria");
- expect(becca.notes[searchResults[1].noteId].title).toEqual("Italy");
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy #capital DESC limit 1', searchContext);
- expect(searchResults.length).toEqual(1);
- searchResults = searchService.findResultsWithQuery('# note.parents.title = Europe orderBy #capital DESC limit 1000', searchContext);
- expect(searchResults.length).toEqual(4);
- });
- it("test not(...)", () => {
- const italy = note("Italy").label("capital", "Rome");
- const slovakia = note("Slovakia").label("capital", "Bratislava");
- rootNote
- .child(note("Europe")
- .child(slovakia)
- .child(italy));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# not(#capital) and note.noteId != root', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Europe");
- searchResults = searchService.findResultsWithQuery('#!capital and note.noteId != root', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Europe");
- });
- it("test note.text *=* something", () => {
- const italy = note("Italy").label("capital", "Rome");
- const slovakia = note("Slovakia").label("capital", "Bratislava");
- rootNote
- .child(note("Europe")
- .child(slovakia)
- .child(italy));
- const searchContext = new SearchContext();
- let searchResults = searchService.findResultsWithQuery('# note.text *=* vaki and note.noteId != root', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Slovakia");
- });
- it("test that fulltext does not match archived notes", () => {
- const italy = note("Italy").label("capital", "Rome");
- const slovakia = note("Slovakia").label("capital", "Bratislava");
- rootNote
- .child(note("Reddit").label('archived', '', true)
- .child(note('Post X'))
- .child(note('Post Y')))
- .child(note ('Reddit is bad'));
- const searchContext = new SearchContext({excludeArchived: true});
- let searchResults = searchService.findResultsWithQuery('reddit', searchContext);
- expect(searchResults.length).toEqual(1);
- expect(becca.notes[searchResults[0].noteId].title).toEqual("Reddit is bad");
- });
- // FIXME: test what happens when we order without any filter criteria
- // it("comparison between labels", () => {
- // rootNote
- // .child(note("Europe")
- // .child(note("Austria")
- // .label('capital', 'Vienna')
- // .label('largestCity', 'Vienna'))
- // .child(note("Canada")
- // .label('capital', 'Ottawa')
- // .label('largestCity', 'Toronto'))
- // .child(note("Czech Republic")
- // .label('capital', 'Prague')
- // .label('largestCity', 'Prague'))
- // );
- //
- // const searchContext = new SearchContext();
- //
- // const searchResults = searchService.findResultsWithQuery('#capital = #largestCity', searchContext);
- // expect(searchResults.length).toEqual(2);
- // expect(findNoteByTitle(searchResults, "Czech Republic")).toBeTruthy();
- // expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy();
- // })
- });
|