From 8f1b3b9f6b68ac234dc654a80fae1afed6f765d6 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 10 Mar 2020 12:12:51 +0100 Subject: [PATCH] cypress test data adjusted to new search mechanism --- backend/src/schema/resolvers/searches.js | 3 +-- cypress/integration/common/search.js | 2 +- cypress/integration/search/Search.feature | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/schema/resolvers/searches.js b/backend/src/schema/resolvers/searches.js index 56913fb3e..918f914cd 100644 --- a/backend/src/schema/resolvers/searches.js +++ b/backend/src/schema/resolvers/searches.js @@ -95,9 +95,8 @@ const createPostQuery = str => { } // start globbing ... escapedString.split(' ').forEach(s => { - if (!s.match(/^(AND|OR|NOT)$/i)) { + if (s.length > 3) { // at least 4 letters. So AND, OR and NOT are never used unquoted - // but the related cypress test expects a search for just two chars. result += ' OR ' + s + '*' } }) diff --git a/cypress/integration/common/search.js b/cypress/integration/common/search.js index 1feece77e..282793547 100644 --- a/cypress/integration/common/search.js +++ b/cypress/integration/common/search.js @@ -43,7 +43,7 @@ Then("I should see the following users in the select dropdown:", table => { }); }); -When("I type {string} and press Enter", value => { +When("I type {PR} and press Enter", value => { cy.get(".searchable-input .ds-select input") .focus() .type(value) diff --git a/cypress/integration/search/Search.feature b/cypress/integration/search/Search.feature index e83f58477..a7bc99d18 100644 --- a/cypress/integration/search/Search.feature +++ b/cypress/integration/search/Search.feature @@ -7,7 +7,7 @@ Feature: Search Given I have a user account And we have the following posts in our database: | id | title | content | - | p1 | 101 Essays that will change the way you think | 101 Essays, of course! | + | p1 | 101 Essays that will change the way you think | 101 Essays, of course (PR)! | | p2 | No searched for content | will be found in this post, I guarantee | And we have the following user accounts: | slug | name | id |