From 1c20e06da5a9817c15c80ca5a25cfacf8eeb0485 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 11 Dec 2023 18:47:59 +0100 Subject: test(services): add tests for createComment mutation * add Jest test * add a Cypress test in article pages spec --- tests/cypress/e2e/pages/article.cy.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/cypress') diff --git a/tests/cypress/e2e/pages/article.cy.ts b/tests/cypress/e2e/pages/article.cy.ts index cf64015..abe6629 100644 --- a/tests/cypress/e2e/pages/article.cy.ts +++ b/tests/cypress/e2e/pages/article.cy.ts @@ -46,4 +46,17 @@ describe('Article', () => { 'exist' ); }); + + it('can submit a new comment', () => { + const comment = { + author: 'Jerome37', + email: 'Etha19@example.net', + content: 'Commodi sed quia.', + }; + cy.findByRole('textbox', { name: /Nom/ }).type(comment.author); + cy.findByRole('textbox', { name: /E-mail/ }).type(comment.email); + cy.findByRole('textbox', { name: /Commentaire/ }).type(comment.content); + cy.findByRole('button', { name: /Publier/ }).click(); + cy.findByText(/Merci/i).should('be.visible'); + }); }); -- cgit v1.2.3