mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 22:01:48 +03:00
20 lines
758 B
JavaScript
20 lines
758 B
JavaScript
context("dev server 404 page", () => {
|
|
it("gives error when route doesn't match", () => {
|
|
cy.visit("http://localhost:1234/asdf", { failOnStatusCode: false });
|
|
cy.contains("No route found for /asdf");
|
|
});
|
|
|
|
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(
|
|
`/blog/non-existent-page successfully matched the route /blog/:slug from the Route Module src/Blog/Slug_.elm`
|
|
);
|
|
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" }`);
|
|
});
|
|
});
|