37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
// The Lucia project.
|
|
// Copyright 2024-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// cindy.chang@dsp.im (Cindy Chang), 2024/07/02
|
|
// imacat.yang@dsp.im (imacat), 2026/03/05
|
|
|
|
import { loginWithFixtures } from "../../support/intercept";
|
|
|
|
describe("Password validation on create account.", () => {
|
|
beforeEach(() => {
|
|
loginWithFixtures();
|
|
cy.visit("/account-admin");
|
|
cy.wait("@getUsers");
|
|
});
|
|
|
|
it("When password is too short, confirm button stays disabled.", () => {
|
|
cy.contains("button", "Create New").should("be.visible").click();
|
|
|
|
cy.get("#input_account_field").type("unit-test-0001");
|
|
cy.get("#input_name_field").type("unit-test-0001");
|
|
// Password shorter than 6 characters
|
|
cy.get("#input_first_pwd").type("aaa");
|
|
|
|
cy.contains("button", "Confirm").should("be.disabled");
|
|
});
|
|
|
|
it("When password meets minimum length, confirm button enables.", () => {
|
|
cy.contains("button", "Create New").should("be.visible").click();
|
|
|
|
cy.get("#input_account_field").type("unit-test-0001");
|
|
cy.get("#input_name_field").type("unit-test-0001");
|
|
cy.get("#input_first_pwd").type("aaaaaa");
|
|
|
|
cy.contains("button", "Confirm").should("be.enabled");
|
|
});
|
|
});
|