1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-05 04:51:30 +01:00
.profile/cypress/e2e/pages/blog/index.cy.ts

25 lines
699 B
TypeScript
Raw Normal View History

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]")
2021-11-09 15:14:31 +01:00
.last()
.should("have.text", "👋 Hello, world!")
cy.get("[data-cy=blog-posts] [data-cy=blog-post-description]")
2021-11-09 15:14:31 +01:00
.last()
.should(
"have.text",
"First post of the blog, introduction and explanation of how this blog is made.",
2021-11-09 15:14:31 +01:00
)
2021-11-08 15:10:26 +01:00
})
it("should redirect the user to the right blog post", () => {
cy.visit("/blog")
cy.get("[data-cy=hello-world]")
2021-11-08 15:10:26 +01:00
.click()
.location("pathname")
.should("eq", "/blog/hello-world")
2021-11-08 15:10:26 +01:00
})
})
export {}