mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-26 13:21:42 +03:00
27 lines
931 B
JavaScript
27 lines
931 B
JavaScript
context("dev server with base path", () => {
|
|
it("submits a form to receive ActionData", () => {
|
|
cy.visit("/form");
|
|
cy.get("input[name=first]").clear().type("John");
|
|
cy.get("input[name=last]").clear().type("Asdf");
|
|
cy.get("button").click();
|
|
cy.contains("Successfully received user John Asdf");
|
|
});
|
|
it("logs in and out", () => {
|
|
cy.visit("/login");
|
|
cy.get("input[name=name]").clear().type("John");
|
|
cy.get("button").click();
|
|
cy.contains("Hello John!");
|
|
cy.contains("Logout").click();
|
|
cy.contains("You have been successfully logged out.");
|
|
});
|
|
it("logs in with errors then re-submits form successfully", () => {
|
|
cy.visit("/login");
|
|
cy.get("input[name=name]").clear().type("error");
|
|
cy.get("button").click();
|
|
cy.contains("Invalid username");
|
|
cy.get("input[name=name]").clear().type("John");
|
|
cy.get("button").click();
|
|
cy.contains("Hello John");
|
|
});
|
|
});
|