From 1fb5307062f002a74ce41839ce9ebbca6a428bdd Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 17 Apr 2026 10:50:14 +0300 Subject: [PATCH] e2e test that created text has root node --- cypress/e2e/admin.cy.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cypress/e2e/admin.cy.js b/cypress/e2e/admin.cy.js index 2c8054c..393b2b4 100644 --- a/cypress/e2e/admin.cy.js +++ b/cypress/e2e/admin.cy.js @@ -26,6 +26,16 @@ describe('The admin page', () => { cy.contains('Test Text') }) + it('shows one root node on the text page', () => { + cy.visit('/admin/texts') + cy.get('#newTextName').type('My Node Text') + cy.get('#submit').click() + cy.intercept('GET', '/api/texts/1/nodes').as('getNodes') + cy.get('a').contains('My Node Text').click() + cy.wait('@getNodes') + cy.get('#text-detail > ul').should('have.length', 1) + }) + it('navigates to a specific texts page', () => { cy.visit('/admin/texts') cy.get('#newTextName').type('My New Text')