Goal-Calibration/cypress/e2e/home.cy.js

21 lines
527 B
JavaScript

describe('The home page', () => {
beforeEach(() => {
cy.exec('npm run db:seed')
cy.loginAsUser()
})
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')
})
})