diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-12-11 18:47:59 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-12-11 18:55:07 +0100 |
| commit | 1c20e06da5a9817c15c80ca5a25cfacf8eeb0485 (patch) | |
| tree | 0162c375602baa70e51d38bdec143dc645628e96 /tests/cypress | |
| parent | 93db24b7f7650abac1bb7095026e3a1f367b0c0a (diff) | |
test(services): add tests for createComment mutation
* add Jest test
* add a Cypress test in article pages spec
Diffstat (limited to 'tests/cypress')
| -rw-r--r-- | tests/cypress/e2e/pages/article.cy.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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'); + }); }); |
