Matt Rider 8ae632be7b Fix component test, comment out form submission from cypress
- Added $t function to test now that it is being localised
- We are submitting the form by clicking on the button as a normal user would
- Cypress test still broken due to peculiarities of tiptap editor
2019-04-24 12:28:53 -03:00

24 lines
583 B
JavaScript

import { When, Then } from 'cypress-cucumber-preprocessor/steps'
When('I should be able to post a comment', () => {
cy.get('[contenteditable]')
.type('This is a comment')
// .get('.ds-form')
// .submit()
.get('button')
.contains('Submit Comment')
.click()
.get('.iziToast-message')
.contains('Comment Submitted')
})
Then('I should see my comment', () => {
cy.get('div.comment p')
.should('contain', 'This is a comment')
})
Then('the editor should be cleared', () => {
cy.get('.ProseMirror p')
.should('have.class', 'is-empty')
})