test home page displays texts
This commit is contained in:
parent
d4473d1ec4
commit
09b906a00f
1 changed files with 20 additions and 0 deletions
20
cypress/e2e/home.cy.js
Normal file
20
cypress/e2e/home.cy.js
Normal 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')
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
Add table
Add a link
Reference in a new issue