2022-01-19 17:10:53 +01:00
|
|
|
/**
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* Copyright (c) UXBOX Labs SL
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
describe("account creation", () => {
|
2022-01-25 16:56:46 +01:00
|
|
|
let validUser;
|
2022-01-19 17:10:53 +01:00
|
|
|
|
|
|
|
beforeEach(() => {
|
2022-01-25 16:56:46 +01:00
|
|
|
cy.fixture("validuser.json").then((user) => {
|
2022-01-19 17:10:53 +01:00
|
|
|
validUser = user;
|
|
|
|
});
|
|
|
|
cy.visit("http://localhost:3449/#/auth/login");
|
2022-01-25 16:56:46 +01:00
|
|
|
cy.getBySel("register-submit").click();
|
2022-01-19 17:10:53 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("displays the account creation form", () => {
|
2022-01-25 16:56:46 +01:00
|
|
|
cy.getBySel("register-form-submit").should("exist");
|
2022-01-19 17:10:53 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("create an account of an existent email fails", () => {
|
|
|
|
cy.get("#email").type(validUser.email);
|
|
|
|
cy.get("#password").type("anewpassword");
|
2022-01-25 16:56:46 +01:00
|
|
|
cy.getBySel("register-form-submit").click();
|
|
|
|
cy.getBySel("email-input-error").should("exist");
|
2022-01-19 17:10:53 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("can go back", () => {
|
2022-01-25 16:56:46 +01:00
|
|
|
cy.getBySel("login-here-link").click();
|
|
|
|
cy.getBySel("login-title").should("exist");
|
2022-01-19 17:10:53 +01:00
|
|
|
cy.get("#email").should("exist");
|
|
|
|
cy.get("#password").should("exist");
|
|
|
|
});
|
|
|
|
});
|