test only one add form open at a time
assert that opening any add-child or bulk-add form closes any other open add form across the tree. currently fails: each toggle function only checks for an open form on its own li.
This commit is contained in:
parent
bd14bfd7a1
commit
d61d68571d
1 changed files with 54 additions and 0 deletions
|
|
@ -120,6 +120,60 @@ describe('The admin text detail page', () => {
|
|||
cy.get('#text-detail li').should('contain', 'Enter Child')
|
||||
})
|
||||
|
||||
it('opening add-child on another node closes the first one', () => {
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('button.add-child')
|
||||
.click()
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('button.add-child')
|
||||
.click()
|
||||
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.should('not.exist')
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('button.save-child')
|
||||
.should('not.exist')
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('opening bulk-add closes an open add-child form', () => {
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('button.add-child')
|
||||
.click()
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('button.bulk-add-children')
|
||||
.click()
|
||||
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.should('not.exist')
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('input.bulk-title')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('newly added child persists after page reload', () => {
|
||||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue