From f09d3ed6856dfc46cfe8ab84c0eb36d67d3300da Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Sat, 2 Feb 2019 17:22:40 -0200 Subject: [PATCH] Write steps, start implemenation of search input component --- components/SearchInput.vue | 179 ++++++++++++++++++++++++++ cypress/integration/06.Search.feature | 4 +- cypress/integration/common/search.js | 11 ++ layouts/default.vue | 13 +- 4 files changed, 204 insertions(+), 3 deletions(-) create mode 100644 components/SearchInput.vue create mode 100644 cypress/integration/common/search.js diff --git a/components/SearchInput.vue b/components/SearchInput.vue new file mode 100644 index 000000000..b3c2b161b --- /dev/null +++ b/components/SearchInput.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/cypress/integration/06.Search.feature b/cypress/integration/06.Search.feature index 16078ede3..a3fc69dae 100644 --- a/cypress/integration/06.Search.feature +++ b/cypress/integration/06.Search.feature @@ -10,5 +10,5 @@ Feature: Search Scenario: Search for specific words Given I am logged in as "user" - And I search for a specific word - Then I should posts with that word included + When I search for a specific word + Then I should see posts with that word included diff --git a/cypress/integration/common/search.js b/cypress/integration/common/search.js new file mode 100644 index 000000000..af46becf0 --- /dev/null +++ b/cypress/integration/common/search.js @@ -0,0 +1,11 @@ +import { When, Then } from 'cypress-cucumber-preprocessor/steps' + +When('I search for a specific word', () => { + cy.get('#nav-search').type('Essays') +}) + +Then('I should see posts with that word included', () => { + cy.get('.ds-card-header:first').then(() => { + cy.title().should('include', 'Essays') + }) +}) diff --git a/layouts/default.vue b/layouts/default.vue index 7283bf308..4e33a1755 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -10,6 +10,9 @@ +