diff --git a/system-tests/e2e/discussions_analysis.cy.js b/system-tests/e2e/discussions_analysis.cy.js index 6e692de4..2fb4759e 100644 --- a/system-tests/e2e/discussions_analysis.cy.js +++ b/system-tests/e2e/discussions_analysis.cy.js @@ -9,11 +9,33 @@ describe('discussions_analysis.cy.js', () => { it('should publish a new post to the discussion section', () => { cy.get('#Discussion').should('exist'); + cy.get('[data-test="new-discussion-button"]').click() + cy.get('[data-test="discussion-post"]').should('have.length', 3); cy.get('[data-test="new-discussion-input"]').type("System Test Text"); cy.get('[data-test="new-discussion-publish"]').click(); cy.get('[data-test="discussion-post"]').should('have.length', 4); - }) + }); + + it('should not be able to publish a post with no text in the new discussion field', () => { + cy.get('#Discussion').should('exist'); + + cy.get('[data-test="new-discussion-button"]').click() + cy.get('[data-test="new-discussion-publish"]').should('be.disabled') + }); + + it('should cancel a new post, close the new post field, and not post anything', () => { + cy.get('#Discussion').should('exist'); + + cy.get('[data-test="new-discussion-button"]').click() + + cy.get('[data-test="new-discussion-input"]').type("System Test Text"); + cy.get('[data-test="new-discussion-cancel"]').click(); + + cy.get('[data-test="new-discussion-input"]').should('not.exist'); + + cy.get('[data-test="discussion-post"]').should('have.length', 3); + }); }); \ No newline at end of file