This commit is contained in:
Robert Schäfer 2019-02-28 02:09:36 +01:00
parent 370748ce55
commit 804cb796b8

View File

@ -151,8 +151,8 @@ When('I press {string}', label => {
})
Given('we have the following posts in our database:', table => {
table.hashes().forEach(({ Author, ...postAttributes}) => {
postAttributes.deleted = Boolean(postAttributes.deleted)
table.hashes().forEach(({ Author, ...postAttributes }) => {
postAttributes.deleted = Boolean(postAttributes.deleted)
postAttributes.disabled = Boolean(postAttributes.disabled)
cy.factory()
.create('User', {
@ -215,14 +215,14 @@ Then('the post was saved successfully', () => {
cy.get('.content').should('contain', lastPost.content)
})
Then(/^I should see only ([0-9]+) posts? on the landing page/, (postCount) => {
Then(/^I should see only ([0-9]+) posts? on the landing page/, postCount => {
cy.get('.post-card').should('have.length', postCount)
})
Then('the first post on the landing page has the title:', (title) => {
Then('the first post on the landing page has the title:', title => {
cy.get('.post-card:first').should('contain', title)
})
Then('I see a 404 error with the following message:', (message) => {
Then('I see a 404 error with the following message:', message => {
cy.get('.error').should('contain', message)
})