From 1d0f30909a6794368af92217e1085c8e31d55c3f Mon Sep 17 00:00:00 2001 From: James Scherer Date: Mon, 4 Dec 2023 16:27:08 -0600 Subject: [PATCH] forgot to add the system test --- system-tests/e2e/discussions_analysis.cy.js | 24 ++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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