From 5b2d85fb9274b2d9229c0b0bde7a1a563022d52e Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Wed, 15 Apr 2026 21:48:54 +0300 Subject: [PATCH] test that clicking on the a tag will bring us to a texts page --- cypress/e2e/admin.cy.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cypress/e2e/admin.cy.js b/cypress/e2e/admin.cy.js index 5dca670..2c8054c 100644 --- a/cypress/e2e/admin.cy.js +++ b/cypress/e2e/admin.cy.js @@ -25,4 +25,17 @@ describe('The admin page', () => { cy.get('#submit').click() cy.contains('Test Text') }) + + it('navigates to a specific texts page', () => { + cy.visit('/admin/texts') + cy.get('#newTextName').type('My New Text') + cy.get('#submit').click() + cy.intercept('GET', '/admin/texts/1').as('textPage') + cy.get('a') + .contains('My New Text') + .should('have.attr', 'href', '/admin/texts/1') + .click() + cy.url().should('include', '/admin/texts/1') + cy.wait('@textPage').its('response.statusCode').should('eq', 200) + }) })