Skip to content

Commit

Permalink
fix(app-signup): remove mandatory special character from password
Browse files Browse the repository at this point in the history
  • Loading branch information
rams23 committed Jan 3, 2021
1 parent f07cf44 commit 88c15f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 5 additions & 5 deletions packages/game-app/cypress/integration/signup.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ context("Signup", () => {
});

it("should not show invalid password error for correct password", () => {
cy.getInputByName('password').fill('Aa1%sfesfsf');
cy.getInputByName('password').fill('Aa1sfesfsf');
cy.get('button').containsTranslationOf('signup.form.buttonText').click();
cy.get('body').should('not.contain.translationOf', 'signup.errors.passwordRequirements')
});
Expand All @@ -42,8 +42,8 @@ context("Signup", () => {
const randomEmail = `testEmail${Math.floor(Math.random() * 1000)}@email.com`.toLocaleLowerCase();
usedEmails.push(randomEmail);
cy.getInputByName('email').fill(randomEmail);
cy.getInputByName('password').fill('Aa1%sfesfsf');
cy.getInputByName('repeatPassword').fill('Aa1%sfesfsf');
cy.getInputByName('password').fill('Aa1sfesfsf');
cy.getInputByName('repeatPassword').fill('Aa1sfesfsf');
cy.getInputByName('role').select('endUser');
cy.getInputByName('devOpsMaturity').select('veryImmature');
cy.get('button').containsTranslationOf('signup.form.buttonText').click();
Expand All @@ -67,8 +67,8 @@ context("Signup", () => {
it("should show email already used error", () => {
const alreadyUsedEmail = usedEmails[0];
cy.getInputByName('email').fill(alreadyUsedEmail);
cy.getInputByName('password').fill('Aa1%sfesfsf');
cy.getInputByName('repeatPassword').fill('Aa1%sfesfsf');
cy.getInputByName('password').fill('Aa1sfesfsf');
cy.getInputByName('repeatPassword').fill('Aa1sfesfsf');
cy.getInputByName('role').select('endUser');
cy.getInputByName('devOpsMaturity').select('veryImmature');
cy.get('button').containsTranslationOf('signup.form.buttonText').click();
Expand Down
5 changes: 1 addition & 4 deletions packages/game-app/src/signup/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ export const signupValidationSchema = yup.object().shape({
password: yup
.string()
.required(requiredError)
.matches(
new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})'),
'signup.errors.passwordRequirements',
),
.matches(new RegExp('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})'), 'signup.errors.passwordRequirements'),
repeatPassword: yup
.string()
.required(requiredError)
Expand Down

0 comments on commit 88c15f3

Please sign in to comment.