Skip to content
Snippets Groups Projects
Commit 7c84a75f authored by Ziwei Wang's avatar Ziwei Wang Committed by Adrien Béraud
Browse files

Fix: missing helper text for the password input field

Since ae51d70f, the helper text should only show when the password is too weak. Text 'strong' is not valid anymore.

Change-Id: Ie4676c82098d8a0eea38d7ca377c3553112d3223
parent b56afd26
No related branches found
No related tags found
No related merge requests found
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
"CLIENT_URL": "http://localhost:3000", "CLIENT_URL": "http://localhost:3000",
"SERVER_URL": "http://localhost:5000", "SERVER_URL": "http://localhost:5000",
"TEST_USERNAME": "your-test-user", "TEST_USERNAME": "your-test-user",
"TEST_USER_PASSWORD": "your-test-password" "TEST_USER_PASSWORD": "your-test-password",
"USED_USERNAME": "your-used-username"
} }
...@@ -39,6 +39,11 @@ describe('registration', () => { ...@@ -39,6 +39,11 @@ describe('registration', () => {
cy.get('[data-cy = "username-input"]').find('[id$=-helper-text]').contains('Username available') cy.get('[data-cy = "username-input"]').find('[id$=-helper-text]').contains('Username available')
cy.get('[data-cy = "password-input"]').type('123456').find('input').should('have.value', '123456')
cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').contains('Too weak')
cy.get('[data-cy = "password-input"]').find('input').clear()
//TODO: Make a cypress custom command that generates a valid password (that is strong determined by passwordStrength() from npm module `check-password-strength`) as well as one generating an invalid one //TODO: Make a cypress custom command that generates a valid password (that is strong determined by passwordStrength() from npm module `check-password-strength`) as well as one generating an invalid one
cy.get('[data-cy = "password-input"]') cy.get('[data-cy = "password-input"]')
.type(`Test-user-${randomId}`) .type(`Test-user-${randomId}`)
...@@ -47,7 +52,7 @@ describe('registration', () => { ...@@ -47,7 +52,7 @@ describe('registration', () => {
//TODO: uncomment the following code when the UI implements the input field for password repeat //TODO: uncomment the following code when the UI implements the input field for password repeat
// cy.get('[data-cy = "password-repeat-input"]').type(`Test/user/${randomId}`).should('have.value', `Test/user/${randomId}`); // cy.get('[data-cy = "password-repeat-input"]').type(`Test/user/${randomId}`).should('have.value', `Test/user/${randomId}`);
cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').contains('Strong') cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').should('not.have', 'Too weak')
cy.get('[data-cy = "register-button"]') cy.get('[data-cy = "register-button"]')
.click() .click()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment