elm-pages-v3-beta/cypress/e2e/elm-pages-dev.cy.js

20 lines
758 B
JavaScript
Raw Normal View History

2021-06-05 04:06:39 +03:00
context("dev server 404 page", () => {
it("gives error when route doesn't match", () => {
2021-06-05 04:06:39 +03:00
cy.visit("http://localhost:1234/asdf", { failOnStatusCode: false });
cy.contains("No route found for /asdf");
2021-06-05 04:06:39 +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`
);
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
});
});