test child creation

This commit is contained in:
Yisroel Baum 2026-06-21 21:44:06 +03:00
parent 416866a22c
commit 7c84eefe78
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 213 additions and 0 deletions

View file

@ -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()