Matt Rider c6b11319fe Clear editor, write cypress test
- the editor only clears once, also there are some other bugs associated with clearing it this way
- according to https://github.com/scrumpy/tiptap/issues/21 there should be a clearContent(), but haven't been able to get it to work
- cypress test for some reason is with a weird bug where I need to submit the form, then click on the submit button, otherwise it doesn't call the handleSubmit method
2019-04-22 11:51:29 -03:00

19 lines
459 B
JavaScript

import { When, Then } from 'cypress-cucumber-preprocessor/steps'
When('I should be able to post a comment', () => {
cy.get('.ProseMirror')
.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')
})