fix: valid username lowercase (#42172)
* fix: valid username lowercase * test: add test in the validate for reject uppercase characters * test: add test in the cypress for check on uppercase characters and reject it.
This commit is contained in:
@ -121,7 +121,7 @@ describe('Username input field', () => {
|
||||
.clear({ force: true })
|
||||
.type('Quincy Larson', { force: true });
|
||||
|
||||
cy.contains('Username "quincy larson" contains invalid characters')
|
||||
cy.contains('Username "Quincy Larson" contains invalid characters')
|
||||
.should('be.visible')
|
||||
.should('have.attr', 'role', 'alert')
|
||||
// We are checking for classes here to check for proper styling
|
||||
@ -198,4 +198,22 @@ describe('Username input field', () => {
|
||||
|
||||
cy.resetUsername();
|
||||
});
|
||||
it('Should show warning if username includes uppercase characters', () => {
|
||||
cy.get('@usernameInput')
|
||||
.clear({ force: true })
|
||||
.type('QuincyLarson', { force: true });
|
||||
|
||||
cy.contains('Username "QuincyLarson" must be lowercase')
|
||||
.should('be.visible')
|
||||
.should('have.attr', 'role', 'alert')
|
||||
.should('have.class', 'alert alert-danger');
|
||||
});
|
||||
|
||||
it('Should not be able to click the `Save` button if username includes uppercase characters', () => {
|
||||
cy.get('@usernameInput')
|
||||
.clear({ force: true })
|
||||
.type('QuincyLarson', { force: true });
|
||||
|
||||
cy.get('@usernameForm').contains('Save').should('be.disabled');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user