31 lines
1.0 KiB
JavaScript
31 lines
1.0 KiB
JavaScript
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');
|
|
});
|
|
});
|