Fix lint issues

And disable eslint when building in prod mode

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-30 10:24:11 +01:00
parent da42522073
commit 2d541f2e32
161 changed files with 3869 additions and 1236 deletions

View File

@@ -11,7 +11,9 @@ describe("Login", () => {
cy.get("form .field").first().contains("label", "Email");
cy.get("form .field").last().contains("label", "Password");
cy.get("form").contains("button.button", "Login");
cy.get("form").contains(".control a.button", "Forgot your password ?").click();
cy.get("form")
.contains(".control a.button", "Forgot your password ?")
.click();
cy.url().should("include", "/password-reset/send");
cy.go("back");
@@ -24,17 +26,22 @@ describe("Login", () => {
it("Tries to login with incorrect credentials", () => {
cy.visit("/login", { onBeforeLoad });
cy.get("input[type=email]").type("notanemail").should("have.value", "notanemail");
cy.get("input[type=email]")
.type("notanemail")
.should("have.value", "notanemail");
cy.get("input[type=password]").click();
cy.contains("button.button.is-primary.is-large", "Login").click();
// cy.get('form .field').first().contains('p.help.is-danger', '@');
// cy.get('form .field').last().contains('p.help.is-danger', 'Please fill out this field.');
});
it("Tries to login with invalid credentials", () => {
cy.visit("/login", { onBeforeLoad });
cy.get("input[type=email]").type("test@email.com").should("have.value", "test@email.com");
cy.get("input[type=password]").type("badPassword").should("have.value", "badPassword");
cy.get("input[type=email]")
.type("test@email.com")
.should("have.value", "test@email.com");
cy.get("input[type=password]")
.type("badPassword")
.should("have.value", "badPassword");
cy.contains("button.button.is-primary.is-large", "Login").click();
cy.contains(
@@ -49,7 +56,10 @@ describe("Login", () => {
cy.get("input[type=password]").type("some password");
cy.get("form").submit();
cy.wait(1000);
cy.get(".navbar-end .navbar-link span.icon i").should("have.class", "mdi-account-circle");
cy.get(".navbar-end .navbar-link span.icon i").should(
"have.class",
"mdi-account-circle"
);
cy.contains("article.message.is-info", "Welcome back I'm a test user");
cy.get(".navbar-item.has-dropdown").click();
cy.get(".navbar-item").last().contains("Log out").click();
@@ -94,7 +104,9 @@ describe("Login", () => {
.parent()
.find("textarea")
.type("This shouln't work because it' using a dupublicated username");
cy.get(".control.has-text-centered").contains("button", "Create my profile").click();
cy.get(".control.has-text-centered")
.contains("button", "Create my profile")
.click();
cy.contains(".help.is-danger", "This username is already taken.");
cy.get("form .field input").first(0).clear().type("test_user_2");
@@ -103,7 +115,13 @@ describe("Login", () => {
cy.get("form").submit();
cy.wait(1000);
cy.get(".navbar-link span.icon i").should("have.class", "mdi-account-circle");
cy.contains("article.message.is-info", "Welcome to Mobilizon, test_user_2!");
cy.get(".navbar-link span.icon i").should(
"have.class",
"mdi-account-circle"
);
cy.contains(
"article.message.is-info",
"Welcome to Mobilizon, test_user_2!"
);
});
});