Merged master in

This commit is contained in:
Grzegorz Leoniec 2019-02-28 10:32:37 +01:00
commit 066d8bcee2
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377
10 changed files with 657 additions and 54 deletions

View File

@ -28,10 +28,10 @@ describe('SearchInput.vue', () => {
})
it('changes searchValue as a user inputs a value', () => {
wrapper = mount(SearchInput, { mocks })
const input = wrapper.find('#nav-search')
wrapper = shallowMount(SearchInput, { mocks })
let input = wrapper.find('#nav-search')
input.element.value = 'abc'
input.trigger('input')
expect(wrapper.vm.searchValue).toBe('abc')
expect(wrapper.vm.value).toBe('abc')
})
})

View File

@ -92,7 +92,7 @@
import { isEmpty } from 'lodash'
export default {
name: 'HcSearchInput',
name: 'SearchInput',
props: {
id: {
type: String,

View File

@ -4,11 +4,12 @@ Feature: Search
In order to find related content
Background:
Given we have the following posts in our database:
| Author | Title | Content | Slug |
| Brianna Wiest | 101 Essays that will change the way you think | 101 Essays, of course! | 101-essays |
Given I have a user account
And we have the following posts in our database:
| Author | id | title | content |
| Brianna Wiest | p1 | 101 Essays that will change the way you think | 101 Essays, of course! |
Scenario: Search for specific words
Given I am logged in as "user"
Given I am logged in
When I search for a specific word
Then I should see posts with that word included
Then I should see posts with that word included

View File

@ -2,7 +2,6 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps'
/* global cy */
When('I navigate to the administration dashboard', () => {
cy.get('.avatar-menu').click()
cy.get('.avatar-menu-popover')
@ -14,11 +13,15 @@ Then('I can see a list of categories ordered by post count:', table => {
cy.get('thead')
.find('tr th')
.should('have.length', 3)
table.hashes().forEach(({Name, Posts}, index) => {
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`)
.should('contain', Name)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`)
.should('contain', Posts)
table.hashes().forEach(({ Name, Posts }, index) => {
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`).should(
'contain',
Name
)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`).should(
'contain',
Posts
)
})
})
@ -26,12 +29,18 @@ Then('I can see a list of tags ordered by user count:', table => {
cy.get('thead')
.find('tr th')
.should('have.length', 4)
table.hashes().forEach(({Name, Users, Posts}, index) => {
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`)
.should('contain', Name)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`)
.should('contain', Users)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(4)`)
.should('contain', Posts)
table.hashes().forEach(({ Name, Users, Posts }, index) => {
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(2)`).should(
'contain',
Name
)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(3)`).should(
'contain',
Users
)
cy.get(`tbody > :nth-child(${index + 1}) > :nth-child(4)`).should(
'contain',
Posts
)
})
})

View File

@ -111,7 +111,7 @@ Then(`I can't see the moderation menu item`, () => {
.should('not.exist')
})
When(/^I confirm the reporting dialog .*:$/, (message) => {
When(/^I confirm the reporting dialog .*:$/, message => {
cy.contains(message) // wait for element to become visible
cy.get('.ds-modal').within(() => {
cy.get('button')

View File

@ -1,11 +1,11 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
When('I search for a specific word', () => {
cy.get('#nav-search').type('Essays')
cy.get('#nav-search')
.focus()
.type('Essays')
})
Then('I should see posts with that word included', () => {
cy.get('.ds-card-header:first').then(() => {
cy.title().should('include', 'Essays')
})
cy.get('.ds-card-header:first').should('contain', 'Essays')
})

View File

@ -152,6 +152,8 @@ When('I press {string}', label => {
Given('we have the following posts in our database:', table => {
table.hashes().forEach(({ Author, id, title, content }) => {
console.log('table', table)
console.log('id', id, 'title', title, 'content', content)
cy.factory()
.create('User', {
name: Author,

View File

@ -15,7 +15,7 @@ beforeEach(async () => {
})
Cypress.Commands.add('factory', () => {
return Factory({seedServerHost})
return Factory({ seedServerHost })
})
Cypress.Commands.add(

View File

@ -36,6 +36,7 @@
}
},
"dependencies": {
"@human-connection/styleguide": "~0.5.0",
"@nuxtjs/apollo": "4.0.0-rc4",
"@nuxtjs/axios": "~5.3.6",
"@nuxtjs/dotenv": "~1.3.0",
@ -45,6 +46,7 @@
"apollo-client": "~2.5.1",
"cookie-universal-nuxt": "~2.0.14",
"cross-env": "~5.2.0",
"cypress": "^3.1.5",
"date-fns": "2.0.0-alpha.27",
"express": "~4.16.4",
"graphql": "~14.1.1",
@ -53,12 +55,11 @@
"nuxt": "~2.4.5",
"nuxt-env": "~0.1.0",
"portal-vue": "~1.5.1",
"@human-connection/styleguide": "~0.5.0",
"v-tooltip": "~2.0.0-rc.33",
"vue-count-to": "~1.0.13",
"string-hash": "^1.1.3",
"tiptap": "^1.13.0",
"tiptap-extensions": "^1.13.0",
"v-tooltip": "~2.0.0-rc.33",
"vue-count-to": "~1.0.13",
"vue-izitoast": "1.1.2",
"vue-sweetalert-icons": "~3.2.0",
"vuex-i18n": "~1.11.0"

636
yarn.lock

File diff suppressed because it is too large Load Diff