From 09b906a00fadd19710e94c829f45dbc15c3f3778 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Thu, 23 Apr 2026 10:01:29 +0300 Subject: [PATCH] test home page displays texts --- cypress/e2e/home.cy.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cypress/e2e/home.cy.js diff --git a/cypress/e2e/home.cy.js b/cypress/e2e/home.cy.js new file mode 100644 index 0000000..d0ba1fe --- /dev/null +++ b/cypress/e2e/home.cy.js @@ -0,0 +1,20 @@ +describe('The home page', () => { + beforeEach(() => { + cy.exec('npm run db:seed') + }) + afterEach(() => { + cy.exec('npm run db:wipe') + }) + + it('displays heading', () => { + cy.visit('/home') + cy.get('h1').should('contain', 'Home') + }) + + it('displays texts from api', () => { + cy.intercept('GET', '/api/texts').as('getTexts') + cy.visit('/home') + cy.wait('@getTexts') + cy.get('#texts-list').should('contain', 'Tanach') + }) +})