From 3b00a3419978fce9fc0803a65bb5eaf65a849ec3 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Tue, 23 Apr 2019 18:19:11 -0300 Subject: [PATCH] Add cypress step to check the editor is cleared --- cypress/integration/common/post.js | 7 ++++++- cypress/integration/post/Comment.feature | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js index fc03b20b3..01601437c 100644 --- a/cypress/integration/common/post.js +++ b/cypress/integration/common/post.js @@ -15,4 +15,9 @@ When('I should be able to post a comment', () => { 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') +}) diff --git a/cypress/integration/post/Comment.feature b/cypress/integration/post/Comment.feature index 164c13bd6..9290d7e21 100644 --- a/cypress/integration/post/Comment.feature +++ b/cypress/integration/post/Comment.feature @@ -10,7 +10,8 @@ Feature: Post Comment And I have a user account And I am logged in - Scenario: + Scenario: Comment creation Given I visit "post/bWBjpkTKZp/101-essays" Then I should be able to post a comment - And I should see my comment \ No newline at end of file + And I should see my comment + And the editor should be cleared