test child add keeps parent expanded
assert that a non-root parent that the user expanded stays expanded after adding a child. currently fails: fetchAndRenderNodes wipes and rebuilds the tree with depth-based default visibility, so any manually expanded non-root collapses on every save.
This commit is contained in:
parent
a9a7461aad
commit
dce4e4a4f6
1 changed files with 36 additions and 0 deletions
|
|
@ -65,6 +65,42 @@ describe('The admin text detail page', () => {
|
|||
cy.get('#text-detail li').should('contain', 'Nested Child Node')
|
||||
})
|
||||
|
||||
it('keeps a parent expanded after adding a child to it', () => {
|
||||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.find('button.toggle-children')
|
||||
.click()
|
||||
cy.get('#text-detail > ul > li > ul > li > ul')
|
||||
.first()
|
||||
.should('be.visible')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('button.add-child')
|
||||
.click()
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.type('Shemos')
|
||||
cy.get('#text-detail > ul > li > ul > li')
|
||||
.first()
|
||||
.children('button.save-child')
|
||||
.click()
|
||||
|
||||
cy.wait('@createNode').its('response.statusCode').should('eq', 201)
|
||||
cy.wait('@getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li > ul > li > ul')
|
||||
.first()
|
||||
.should('be.visible')
|
||||
cy.get('#text-detail > ul > li > ul > li > ul')
|
||||
.first()
|
||||
.should('contain', 'Shemos')
|
||||
})
|
||||
|
||||
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