From 07b2b7ca3bc80a2435f3f1bc2c40669ba55933a3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 6 Jan 2020 18:36:59 +0100 Subject: [PATCH] Please pass the tests now --- backend/src/schema/resolvers/searches.js | 4 ++-- cypress/integration/search/Search.feature | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/schema/resolvers/searches.js b/backend/src/schema/resolvers/searches.js index 1005f6576..7f1eeecee 100644 --- a/backend/src/schema/resolvers/searches.js +++ b/backend/src/schema/resolvers/searches.js @@ -10,9 +10,9 @@ export default { .replace(/\s+/g, ' ') .replace(/[[@#:*~\\$|^\]?/"'(){}+?!,.-]/g, '') .split(' ') - .map(s => s.toLowerCase().match(/^(not|and|or)$/)? '"' + s + '"' : s + '*') + .map(s => (s.toLowerCase().match(/^(not|and|or)$/) ? '"' + s + '"' : s + '*')) .join(' ') - //console.log(myQuery) + // console.log(myQuery) const postCypher = ` CALL db.index.fulltext.queryNodes('post_fulltext_search', $query) YIELD node as resource, score diff --git a/cypress/integration/search/Search.feature b/cypress/integration/search/Search.feature index bae30cd2a..e83f58477 100644 --- a/cypress/integration/search/Search.feature +++ b/cypress/integration/search/Search.feature @@ -24,7 +24,7 @@ Feature: Search | 101 Essays that will change the way you think | Scenario: Press enter starts search - When I type "Ess" and press Enter + When I type "Es" and press Enter Then I should have one item in the select dropdown Then I should see the following posts in the select dropdown: | title |