test that clicking on the a tag will bring us to a texts page

This commit is contained in:
Yisroel Baum 2026-04-15 21:48:54 +03:00
parent 3689945cfe
commit 5b2d85fb92
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -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)
})
})