test child deletion
This commit is contained in:
parent
34b0fd0b44
commit
11a0b1576f
3 changed files with 375 additions and 0 deletions
|
|
@ -163,6 +163,34 @@ describe('admin element editing', () => {
|
|||
cy.resetDb()
|
||||
})
|
||||
|
||||
it('removes a child element after confirmation', () => {
|
||||
cy.resetDb()
|
||||
loginAsAdmin()
|
||||
cy.visit('/admin/element/1')
|
||||
cy.intercept('DELETE', /\/api\/elements\/1\/children\/\d+$/)
|
||||
.as('deleteChildElement')
|
||||
cy.window().then((windowObject) => {
|
||||
cy.stub(windowObject, 'confirm').returns(true)
|
||||
})
|
||||
|
||||
cy.contains('[data-cy="admin-child-item"]', '1. Introduction')
|
||||
.within(() => {
|
||||
cy.contains('button', 'Remove').click()
|
||||
})
|
||||
cy.wait('@deleteChildElement')
|
||||
|
||||
cy.get('[data-cy="admin-child-status"]')
|
||||
.should('be.visible')
|
||||
.and('contain.text', 'Child element removed')
|
||||
cy.contains('[data-cy="admin-child-item"]', '1. Introduction')
|
||||
.should('not.exist')
|
||||
cy.contains('header.site-header a', 'View Element').click()
|
||||
cy.get('[data-cy="child-element-list"]')
|
||||
.should('not.contain.text', '1. Introduction')
|
||||
|
||||
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