activate node before clicking action buttons in tests

This commit is contained in:
Yisroel Baum 2026-05-04 10:03:54 +03:00
parent c73cbe2f1a
commit 793b0149b8
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
5 changed files with 39 additions and 13 deletions

View file

@ -32,7 +32,8 @@ describe('The admin text detail page', () => {
})
it('clicking "Add child" reveals an inline form', () => {
cy.get('#text-detail li').first().children('button.add-child').click()
cy.get('#text-detail li').first().activateNode()
.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')
})
@ -41,7 +42,8 @@ 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().children('button.add-child').click()
cy.get('#text-detail > ul > li').first().activateNode()
.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()
@ -55,7 +57,8 @@ 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().children('button.add-child').click()
cy.get('#text-detail > ul > li > ul > li').first().activateNode()
.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()
@ -69,6 +72,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()
.activateNode()
cy.get('#text-detail > ul > li > ul > li')
.first()
.find('button.toggle-children')
@ -107,6 +113,7 @@ describe('The admin text detail page', () => {
cy.get('#text-detail > ul > li')
.first()
.activateNode()
.children('button.add-child')
.click()
cy.get('#text-detail > ul > li')
@ -123,6 +130,7 @@ describe('The admin text detail page', () => {
it('opening add-child on another node closes the first one', () => {
cy.get('#text-detail > ul > li')
.first()
.activateNode()
.children('button.add-child')
.click()
cy.get('#text-detail > ul > li')
@ -132,6 +140,7 @@ describe('The admin text detail page', () => {
cy.get('#text-detail > ul > li > ul > li')
.first()
.activateNode()
.children('button.add-child')
.click()
@ -152,6 +161,7 @@ describe('The admin text detail page', () => {
it('opening bulk-add closes an open add-child form', () => {
cy.get('#text-detail > ul > li')
.first()
.activateNode()
.children('button.add-child')
.click()
cy.get('#text-detail > ul > li')
@ -161,6 +171,7 @@ describe('The admin text detail page', () => {
cy.get('#text-detail > ul > li > ul > li')
.first()
.activateNode()
.children('button.bulk-add-children')
.click()
@ -178,7 +189,8 @@ 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().children('button.add-child').click()
cy.get('#text-detail > ul > li').first().activateNode()
.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()