From b12d0fc7d3180e074a721a49629a962225fc1f12 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Sat, 18 Apr 2026 21:48:41 +0300 Subject: [PATCH] fix cypress tests to properly select in children --- cypress/e2e/adminText.cy.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/adminText.cy.js b/cypress/e2e/adminText.cy.js index 9dae1bf..18daef3 100644 --- a/cypress/e2e/adminText.cy.js +++ b/cypress/e2e/adminText.cy.js @@ -31,18 +31,18 @@ describe('The admin text detail page', () => { }) it('clicking "Add child" reveals an inline form', () => { - cy.get('#text-detail li').first().find('button.add-child').click() - cy.get('#text-detail li').first().find('input.child-title').should('be.visible') - cy.get('#text-detail li').first().find('button.save-child').should('be.visible') + cy.get('#text-detail li').first().children('button.add-child').click() + cy.get('#text-detail li').first().children('input.child-title').should('be.visible') + cy.get('#text-detail li').first().children('button.save-child').should('be.visible') }) it('can add a child to the root node', () => { cy.intercept('POST', '/api/nodes').as('createNode') cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh') - cy.get('#text-detail > ul > li').first().find('button.add-child').click() - cy.get('#text-detail > ul > li').first().find('input.child-title').type('New Child Node') - cy.get('#text-detail > ul > li').first().find('button.save-child').click() + cy.get('#text-detail > ul > li').first().children('button.add-child').click() + cy.get('#text-detail > ul > li').first().children('input.child-title').type('New Child Node') + cy.get('#text-detail > ul > li').first().children('button.save-child').click() cy.wait('@createNode').its('response.statusCode').should('eq', 201) cy.wait('@getNodesRefresh') @@ -54,9 +54,9 @@ describe('The admin text detail page', () => { 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.add-child').click() - cy.get('#text-detail > ul > li > ul > li').first().find('input.child-title').type('Nested Child Node') - cy.get('#text-detail > ul > li > ul > li').first().find('button.save-child').click() + 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('Nested Child Node') + 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') @@ -68,9 +68,9 @@ describe('The admin text detail page', () => { cy.intercept('POST', '/api/nodes').as('createNode') cy.intercept('GET', '/api/nodes/0').as('getNodesRefresh') - cy.get('#text-detail > ul > li').first().find('button.add-child').click() - cy.get('#text-detail > ul > li').first().find('input.child-title').type('Persistent Child') - cy.get('#text-detail > ul > li').first().find('button.save-child').click() + cy.get('#text-detail > ul > li').first().children('button.add-child').click() + cy.get('#text-detail > ul > li').first().children('input.child-title').type('Persistent Child') + cy.get('#text-detail > ul > li').first().children('button.save-child').click() cy.wait('@createNode') cy.wait('@getNodesRefresh')