From 7bc853e631c6bb3bf2bc8649ada3851e84d41a04 Mon Sep 17 00:00:00 2001 From: Joseph Chalabi <100090645+chalabi2@users.noreply.github.com> Date: Sun, 1 Sep 2024 01:05:17 -0700 Subject: [PATCH] remove duplicate tests Signed-off-by: Joseph Chalabi <100090645+chalabi2@users.noreply.github.com> --- .../groups/forms/groups/MemberInfoForm.tsx | 2 +- .../groups/__tests__/MemberInfoForm.test.tsx | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/components/groups/forms/groups/MemberInfoForm.tsx b/components/groups/forms/groups/MemberInfoForm.tsx index d1cde1ba..1d7287f0 100644 --- a/components/groups/forms/groups/MemberInfoForm.tsx +++ b/components/groups/forms/groups/MemberInfoForm.tsx @@ -8,7 +8,7 @@ import { isValidAddress } from '@/utils/string'; const MemberSchema = Yup.object().shape({ address: Yup.string() - .test('is-valid-address', 'Invalid address format', isValidAddress) + .test('is-valid-address', 'Invalid address format', value => isValidAddress(value || '')) .required('Required'), name: Yup.string().required('Required'), weight: Yup.number().min(1, 'Must be at least 1').required('Required'), diff --git a/components/groups/forms/groups/__tests__/MemberInfoForm.test.tsx b/components/groups/forms/groups/__tests__/MemberInfoForm.test.tsx index 277eba44..fd806680 100644 --- a/components/groups/forms/groups/__tests__/MemberInfoForm.test.tsx +++ b/components/groups/forms/groups/__tests__/MemberInfoForm.test.tsx @@ -70,25 +70,6 @@ describe('MemberInfoForm Component', () => { }); }); - test('validates address format', async () => { - renderWithChainProvider(); - const addressInput = screen.getAllByLabelText('Address')[0] as HTMLInputElement; - - fireEvent.change(addressInput, { target: { value: 'invalid_address' } }); - fireEvent.blur(addressInput); - - await new Promise(resolve => setTimeout(resolve, 0)); - - expect(addressInput).toHaveAttribute('aria-invalid', 'true'); - - fireEvent.change(addressInput, { target: { value: 'manifest1validaddress' } }); - fireEvent.blur(addressInput); - - await new Promise(resolve => setTimeout(resolve, 0)); - - expect(addressInput).not.toHaveAttribute('aria-invalid', 'true'); - }); - test('next button is disabled when address is invalid', async () => { const invalidFormData = { ...mockGroupFormData,