Fix eslint

This commit is contained in:
Robert Schäfer 2019-01-21 15:16:13 +01:00
parent e63e346720
commit 6efa2b01c9
4 changed files with 35 additions and 32 deletions

View File

@ -3,9 +3,9 @@ import { Given, When, Then } from 'cypress-cucumber-preprocessor/steps'
/* global cy */
let lastReportTitle
let dummyReportedPostTitle = "Hacker, Freaks und Funktionäre"
let dummyReportedPostSlug = 'hacker-freaks-und-funktionareder-ccc'
let dummyAuthorName = "Jenny Rostock"
let dummyReportedPostTitle = 'Hacker, Freaks und Funktionäre'
let dummyReportedPostSlug = 'hacker-freaks-und-funktionareder-ccc'
let dummyAuthorName = 'Jenny Rostock'
const savePostTitle = $post => {
return $post
@ -18,11 +18,11 @@ const savePostTitle = $post => {
})
}
Given('I see David Irving\'s post on the landing page', (page) => {
Given("I see David Irving's post on the landing page", page => {
cy.openPage('landing')
})
Given('I see David Irving\'s post on the post page', (page) => {
Given("I see David Irving's post on the post page", page => {
cy.visit(`/post/${dummyReportedPostSlug}`)
cy.contains(dummyReportedPostTitle) // wait
})
@ -31,29 +31,35 @@ Given('I am logged in with a {string} role', role => {
cy.loginAs(role)
})
When('I click on "Report Contribution" from the triple dot menu of the post', () => {
//TODO: match the created post title, not a dummy post title
cy.contains('.ds-card', dummyReportedPostTitle)
.find('.content-menu-trigger')
.first()
.click()
When(
'I click on "Report Contribution" from the triple dot menu of the post',
() => {
//TODO: match the created post title, not a dummy post title
cy.contains('.ds-card', dummyReportedPostTitle)
.find('.content-menu-trigger')
.first()
.click()
cy.get('.popover .ds-menu-item-link')
.contains('Report Contribution')
.click()
})
cy.get('.popover .ds-menu-item-link')
.contains('Report Contribution')
.click()
}
)
When('I click on "Report User" from the triple dot menu in the user info box', () => {
//TODO: match the created post author, not a dummy author
cy.contains('.ds-card', dummyAuthorName)
.find('.content-menu-trigger')
.first()
.click()
When(
'I click on "Report User" from the triple dot menu in the user info box',
() => {
//TODO: match the created post author, not a dummy author
cy.contains('.ds-card', dummyAuthorName)
.find('.content-menu-trigger')
.first()
.click()
cy.get('.popover .ds-menu-item-link')
.contains('Report User')
.click()
})
cy.get('.popover .ds-menu-item-link')
.contains('Report User')
.click()
}
)
When('I click on the author', () => {
cy.get('a.author')
@ -114,7 +120,7 @@ When(/^I confirm the reporting dialog .*:$/, () => {
})
Given('somebody reported the following posts:', table => {
table.hashes().forEach((row) => {
table.hashes().forEach(row => {
//TODO: calll factory here
// const options = Object.assign({}, row, { reported: true })
//create('post', options)

View File

@ -85,14 +85,13 @@ When('I press {string}', label => {
})
Given('we have the following posts in our database:', table => {
table.hashes().forEach((row) => {
table.hashes().forEach(row => {
//TODO: calll factory here
//create('post', row)
})
})
Then('I see a success message:', (message) => {
Then('I see a success message:', message => {
cy.contains(message)
})

View File

@ -66,14 +66,13 @@ Cypress.Commands.add('logout', (email, password) => {
cy.location('pathname').should('contain', '/login') // we're out
})
Cypress.Commands.add('openPage', (page) => {
Cypress.Commands.add('openPage', page => {
if (page === 'landing') {
page = ''
}
cy.visit(`/${page}`)
})
//
//
// -- This is a child command --

View File

@ -1,4 +1,3 @@
import find from 'lodash/find'
const helpers = {