From fefdd12db2329d9fd5da182c326080ff43bd4b9c Mon Sep 17 00:00:00 2001 From: Yury Barsukou Date: Wed, 6 Nov 2024 12:24:09 +0300 Subject: [PATCH 1/3] Update src/SignUpForm.js --- src/SignUpForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SignUpForm.js b/src/SignUpForm.js index 400b66b..2035656 100644 --- a/src/SignUpForm.js +++ b/src/SignUpForm.js @@ -34,7 +34,7 @@ const SignUpForm = () => { hasUppercase: /[A-Z]/.test(password), hasLowercase: /[a-z]/.test(password), hasNumber: /[0-9]/.test(password), - isLongEnough: password.length >= 8, + isLongEnough: password.length >= 10, }); }; From 43a6bb7b27a7da24836beb5060716b0d2cd53e91 Mon Sep 17 00:00:00 2001 From: Yury Barsukou Date: Wed, 6 Nov 2024 12:24:13 +0300 Subject: [PATCH 2/3] Update src/SignUpForm.js --- src/SignUpForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SignUpForm.js b/src/SignUpForm.js index 2035656..d913aee 100644 --- a/src/SignUpForm.js +++ b/src/SignUpForm.js @@ -134,7 +134,7 @@ const SignUpForm = () => { 1 number
  • - Minimum 8 characters + Minimum 10 characters
  • From e791e0c4c20f5a1d1cf966bf9dd5a2d1bf6e7f49 Mon Sep 17 00:00:00 2001 From: Yury Barsukou Date: Wed, 6 Nov 2024 12:24:20 +0300 Subject: [PATCH 3/3] Update src/SignUpForm.test.js --- src/SignUpForm.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SignUpForm.test.js b/src/SignUpForm.test.js index f4ea4aa..711f5be 100644 --- a/src/SignUpForm.test.js +++ b/src/SignUpForm.test.js @@ -61,12 +61,12 @@ describe('SignUpForm', () => { test('validates password criteria correctly', () => { const password = screen.getByLabelText(LABELS.password); fireEvent.change(password, { target: { value: 'short' } }); - expect(screen.getByText(/Minimum 8 characters/i).className).toMatch(/red/); + expect(screen.getByText(/Minimum 10 characters/i).className).toMatch(/red/); fireEvent.change(password, { target: { value: 'LongEnough1' } }); expect(screen.getByText(/1 uppercase character/i).className).toMatch(/green/); expect(screen.getByText(/1 lowercase character/i).className).toMatch(/green/); expect(screen.getByText(/1 number/i).className).toMatch(/green/); - expect(screen.getByText(/Minimum 8 characters/i).className).toMatch(/green/); + expect(screen.getByText(/Minimum 10 characters/i).className).toMatch(/green/); }); });