test child creation
This commit is contained in:
parent
416866a22c
commit
7c84eefe78
3 changed files with 213 additions and 0 deletions
|
|
@ -139,6 +139,30 @@ describe('admin element editing', () => {
|
|||
cy.get('[data-cy="element-rich-text"]').should('not.exist')
|
||||
})
|
||||
|
||||
it('adds a child element and opens it for editing', () => {
|
||||
cy.resetDb()
|
||||
loginAsAdmin()
|
||||
cy.visit('/admin/element/1')
|
||||
cy.intercept('POST', /\/api\/elements\/1\/children$/)
|
||||
.as('createChildElement')
|
||||
|
||||
cy.get('[data-cy="admin-child-title"]').type('Admin added child')
|
||||
cy.get('[data-cy="admin-add-child"]').click()
|
||||
cy.wait('@createChildElement')
|
||||
|
||||
cy.location('pathname').should('match', /^\/admin\/element\/\d+$/)
|
||||
cy.get('[data-cy="admin-element-title"]')
|
||||
.should('have.value', 'Admin added child')
|
||||
cy.contains('header.site-header a', 'View Element').click()
|
||||
cy.contains('h1', 'Admin added child').should('be.visible')
|
||||
|
||||
cy.visit('/element/1')
|
||||
cy.get('[data-cy="child-element-list"]')
|
||||
.should('contain.text', 'Admin added child')
|
||||
|
||||
cy.resetDb()
|
||||
})
|
||||
|
||||
it('uploads icon and pdf files immediately through the UI', () => {
|
||||
cy.resetDb()
|
||||
loginAsAdmin()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue