add cypress tests for admin text summary page
This commit is contained in:
parent
bb3397b751
commit
688373f46d
1 changed files with 21 additions and 4 deletions
|
|
@ -1,7 +1,24 @@
|
|||
describe('The admin page', () => {
|
||||
it('successfully loads texts', () => {
|
||||
cy.visit('/admin')
|
||||
cy.get('#newTextname').type('new text')
|
||||
cy.get('#submit').click()
|
||||
beforeEach(() => {
|
||||
cy.visit('/admin')
|
||||
})
|
||||
|
||||
it('navigates to texts page', () => {
|
||||
cy.get('#texts').click()
|
||||
cy.url().should('include', '/admin/texts')
|
||||
})
|
||||
|
||||
it('shows texts page with heading and form', () => {
|
||||
cy.visit('/admin/texts')
|
||||
cy.get('h1').should('contain', 'Texts')
|
||||
cy.get('#newTextName').should('exist')
|
||||
cy.get('#submit').should('exist')
|
||||
})
|
||||
|
||||
it('creates a new text', () => {
|
||||
cy.visit('/admin/texts')
|
||||
cy.get('#newTextName').type('Test Text')
|
||||
cy.get('#submit').click()
|
||||
cy.contains('Test Text')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue