2023-10-23 23:11:59 +02:00
|
|
|
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()
|
2023-10-23 23:11:59 +02:00
|
|
|
.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(
|
2023-10-23 23:11:59 +02:00
|
|
|
"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
|
|
|
})
|
|
|
|
|
2023-10-23 23:11:59 +02: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()
|
2023-10-23 23:11:59 +02:00
|
|
|
.location("pathname")
|
|
|
|
.should("eq", "/blog/hello-world")
|
2021-11-08 15:10:26 +01:00
|
|
|
})
|
|
|
|
})
|
2022-07-28 22:51:12 +02:00
|
|
|
|
|
|
|
export {}
|