test enter submits add child form
assert that pressing enter while typing in the add-child input submits the form. currently fails: only the save-child button click triggers the post.
This commit is contained in:
parent
838c31293e
commit
74705379cb
1 changed files with 19 additions and 0 deletions
|
|
@ -101,6 +101,25 @@ describe('The admin text detail page', () => {
|
|||
.should('contain', 'Shemos')
|
||||
})
|
||||
|
||||
it('pressing Enter in the add-child input submits', () => {
|
||||
cy.intercept('POST', '/api/nodes').as('createNode')
|
||||
cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('button.add-child')
|
||||
.click()
|
||||
cy.get('#text-detail > ul > li')
|
||||
.first()
|
||||
.children('input.child-title')
|
||||
.type('Enter Child{enter}')
|
||||
|
||||
cy.wait('@createNode').its('response.statusCode').should('eq', 201)
|
||||
cy.wait('@getNodesRefresh')
|
||||
|
||||
cy.get('#text-detail li').should('contain', 'Enter Child')
|
||||
})
|
||||
|
||||
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