1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-09-19 22:15:53 +02:00
.profile/cypress/integration/pages/blog/index.spec.ts
2022-02-20 15:12:10 +01:00

27 lines
815 B
TypeScript

describe('Page /blog', () => {
it('should displays the blog posts sorted from newest to oldest', () => {
cy.visit('/blog')
cy.get('[data-cy=blog-posts] [data-cy=blog-post-title]')
.last()
.should('have.text', '👋 Hello, world!')
cy.get('[data-cy=blog-posts] [data-cy=blog-post-description]')
.last()
.should(
'have.text',
'First post of the blog, introduction and explanation of how this blog is made.'
)
cy.get('[data-cy=blog-posts] [data-cy=blog-post-date]')
.last()
.should('have.text', '06/10/2021')
})
it('should redirect the user to the right blog post', () => {
cy.visit('/blog')
cy.get('[data-cy=blog-posts]')
.last()
.click()
.location('pathname')
.should('eq', '/blog/hello-world')
})
})