2021-06-05 04:06:39 +03:00
|
|
|
context("dev server 404 page", () => {
|
2022-02-25 21:40:08 +03:00
|
|
|
it("gives error when route doesn't match", () => {
|
2021-06-05 04:06:39 +03:00
|
|
|
cy.visit("http://localhost:1234/asdf", { failOnStatusCode: false });
|
2022-02-25 21:40:08 +03:00
|
|
|
cy.contains("No route found for /asdf");
|
2021-06-05 04:06:39 +03:00
|
|
|
});
|
|
|
|
|
2022-02-25 21:40:08 +03:00
|
|
|
it("gives error when route matches but page isn't pre-rendered", () => {
|
|
|
|
cy.visit("http://localhost:1234/blog/non-existent-page", {
|
|
|
|
failOnStatusCode: false,
|
|
|
|
});
|
|
|
|
cy.contains(
|
2022-03-10 00:51:35 +03:00
|
|
|
`/blog/non-existent-page successfully matched the route /blog/:slug from the Route Module src/Blog/Slug_.elm`
|
2022-02-25 21:40:08 +03:00
|
|
|
);
|
|
|
|
cy.contains(
|
|
|
|
`But this Page module has no pre-rendered routes! If you want to pre-render this page, add these RouteParams to the module's routes`
|
|
|
|
);
|
|
|
|
cy.contains(`{ slug = "non-existent-page" }`);
|
2021-06-05 04:06:39 +03:00
|
|
|
});
|
|
|
|
});
|