test that clicking on the a tag will bring us to a texts page
This commit is contained in:
parent
3689945cfe
commit
5b2d85fb92
1 changed files with 13 additions and 0 deletions
|
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue