scope user text child-add cypress selectors

the seeded text already has nested nodes, so 'li.first()'
matched multiple buttons. scope the selectors to top-level
li children to match the working pattern in adminText.cy.js.
This commit is contained in:
Yisroel Baum 2026-05-02 21:58:34 +03:00
parent c065e065e9
commit 3a1e91cc4f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -30,11 +30,12 @@ describe('The user text detail page', () => {
cy.visit('/texts/0') cy.visit('/texts/0')
cy.wait('@getNodes') cy.wait('@getNodes')
cy.get('#text-detail li').first().within(() => { cy.get('#text-detail > ul > li').first()
cy.get('button.add-child').click() .children('button.add-child').click()
cy.get('input.child-title').type('My new child') cy.get('#text-detail > ul > li').first()
cy.get('button.save-child').click() .children('input.child-title').type('My new child')
}) cy.get('#text-detail > ul > li').first()
.children('button.save-child').click()
cy.contains('My new child') cy.contains('My new child')
}) })