diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 8f3011a92..6c07e1cc2 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -162,10 +162,10 @@ type Query { blockedUsers: [User] isLoggedIn: Boolean! - currentUser: User - findUsers(query: String!,limit: Int = 10, filter: _UserFilter): [User]! + currentUser: User + findUsers(query: String!,limit: Int = 10, filter: _UserFilter): [User]! @cypher( - statement: """ + statement: """ CALL db.index.fulltext.queryNodes('user_fulltext_search', $query) YIELD node as post, score MATCH (user) @@ -192,8 +192,7 @@ type Mutation { termsAndConditionsAgreedAt: String allowEmbedIframes: Boolean showShoutsPublicly: Boolean - - locale: String + locale: String ): User DeleteUser(id: ID!, resource: [Deletable]): User diff --git a/cypress/integration/common/search.js b/cypress/integration/common/search.js index 2b2dbc8b7..118b165dc 100644 --- a/cypress/integration/common/search.js +++ b/cypress/integration/common/search.js @@ -1,6 +1,6 @@ import { When, Then } from "cypress-cucumber-preprocessor/steps"; When("I search for {string}", value => { - cy.get("#search-resources") + cy.get("[data-test=search-field]") .focus() .type(value); }); @@ -16,7 +16,7 @@ Then("the search has no results", () => { expect($li).to.have.length(1); }); cy.get(".ds-select-dropdown").should("contain", 'Nothing found'); - cy.get("#search-resources") + cy.get("[data-test=search-field]") .focus() .type("{esc}"); }); @@ -35,21 +35,21 @@ Then("I should see the following users in the select dropdown:", table => { }); When("I type {string} and press Enter", value => { - cy.get("#search-resources") + cy.get("[data-test=search-field]") .focus() .type(value) .type("{enter}", { force: true }); }); When("I type {string} and press escape", value => { - cy.get("#search-resources") + cy.get("[data-test=search-field]") .focus() .type(value) .type("{esc}"); }); Then("the search field should clear", () => { - cy.get("#search-resources").should("have.text", ""); + cy.get("[data-test=search-field]").should("have.text", ""); }); When("I select a post entry", () => { @@ -94,4 +94,4 @@ Then("I select a user entry", () => { Then("I should be on the user's profile", () => { cy.location("pathname").should("eq", "/profile/user-for-search/search-for-me") -}) \ No newline at end of file +}) diff --git a/webapp/components/features/SearchResources/SearchResources.spec.js b/webapp/components/features/SearchField/SearchField.spec.js similarity index 87% rename from webapp/components/features/SearchResources/SearchResources.spec.js rename to webapp/components/features/SearchField/SearchField.spec.js index f09e21274..70ba2cedd 100644 --- a/webapp/components/features/SearchResources/SearchResources.spec.js +++ b/webapp/components/features/SearchField/SearchField.spec.js @@ -1,15 +1,15 @@ import { config, mount } from '@vue/test-utils' import Vuex from 'vuex' -import SearchResources from './SearchResources.vue' +import SearchField from './SearchField.vue' import SearchableInput from '~/components/generic/SearchableInput/SearchableInput' -import { results as searchResults } from './SearchResources.story' +import { results as searchResults } from './SearchField.story' const localVue = global.localVue localVue.filter('truncate', () => 'truncated string') localVue.filter('dateTime', () => Date.now) config.stubs['nuxt-link'] = '' -describe('SearchResources.vue', () => { +describe('SearchField.vue', () => { let mocks, wrapper, getters beforeEach(() => { mocks = { @@ -26,7 +26,7 @@ describe('SearchResources.vue', () => { const store = new Vuex.Store({ getters, }) - return mount(SearchResources, { mocks, localVue, store }) + return mount(SearchField, { mocks, localVue, store }) } describe('mount', () => { diff --git a/webapp/components/features/SearchResources/SearchResources.story.js b/webapp/components/features/SearchField/SearchField.story.js similarity index 92% rename from webapp/components/features/SearchResources/SearchResources.story.js rename to webapp/components/features/SearchField/SearchField.story.js index c2cd8f4fa..5ff41cb27 100644 --- a/webapp/components/features/SearchResources/SearchResources.story.js +++ b/webapp/components/features/SearchField/SearchField.story.js @@ -1,6 +1,6 @@ import { storiesOf } from '@storybook/vue' import { withA11y } from '@storybook/addon-a11y' -import SearchResources from './SearchResources.vue' +import SearchField from './SearchField.vue' import helpers from '~/storybook/helpers' helpers.init() @@ -100,19 +100,18 @@ export const results = [ }, ] -storiesOf('Search Input', module) +storiesOf('Search Field', module) .addDecorator(withA11y) .addDecorator(helpers.layout) .add('test', () => ({ - components: { SearchResources }, + components: { SearchField }, store: helpers.store, data: () => ({ results: results, }), template: ` - `, })) diff --git a/webapp/components/features/SearchResources/SearchResources.vue b/webapp/components/features/SearchField/SearchField.vue similarity index 94% rename from webapp/components/features/SearchResources/SearchResources.vue rename to webapp/components/features/SearchField/SearchField.vue index d0be17569..29ab8650d 100644 --- a/webapp/components/features/SearchResources/SearchResources.vue +++ b/webapp/components/features/SearchField/SearchField.vue @@ -1,7 +1,6 @@