From 9ced96fc886b6ef504af7b6e76091883800e72b2 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 24 Apr 2026 10:20:27 +0300 Subject: [PATCH] test create plan button visibility --- cypress/e2e/homeCreatePlan.cy.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cypress/e2e/homeCreatePlan.cy.js diff --git a/cypress/e2e/homeCreatePlan.cy.js b/cypress/e2e/homeCreatePlan.cy.js new file mode 100644 index 0000000..a7ce2bf --- /dev/null +++ b/cypress/e2e/homeCreatePlan.cy.js @@ -0,0 +1,18 @@ +describe('Create plan modal on the home page', () => { + beforeEach(() => { + cy.exec('npm run db:seed') + cy.intercept('GET', '/api/texts').as('getTexts') + cy.visit('/home') + cy.wait('@getTexts') + }) + + afterEach(() => { + cy.exec('npm run db:wipe') + }) + + it('shows a "Create plan" button on each text', () => { + cy.get('#texts-list li').each((textItem) => { + cy.wrap(textItem).find('button.create-plan').should('exist') + }) + }) +})