test home page displays texts

This commit is contained in:
Yisroel Baum 2026-04-23 10:01:29 +03:00
parent d4473d1ec4
commit 09b906a00f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

20
cypress/e2e/home.cy.js Normal file
View file

@ -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')
})
})