Skip to content

Commit

Permalink
Merge branch 'develop' into fix/split-upe-with-woopay-and-multiple-pms
Browse files Browse the repository at this point in the history
  • Loading branch information
timur27 authored Jul 20, 2023
2 parents b207d94 + 0d3acb7 commit d623ec2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-6783-specific-validation-text-po
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Adding more descriptive error messages in gradual signup
21 changes: 21 additions & 0 deletions client/onboarding/strings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,33 @@ export default {
},
errors: {
generic: __( 'Please provide a response', 'woocommerce-payments' ),
'individual.first_name': __(
'Please provide a first name',
'woocommerce-payments'
),
'individual.last_name': __(
'Please provide a last name',
'woocommerce-payments'
),
email: __( 'Please provide a valid email', 'woocommerce-payments' ),
phone: __(
'Please provide a valid phone number',
'woocommerce-payments'
),
url: __( 'Please provide a valid website', 'woocommerce-payments' ),
business_name: __(
'Please provide a business name',
'woocommerce-payments'
),
country: __( 'Please provide a country', 'woocommerce-payments' ),
business_type: __(
'Please provide a business type',
'woocommerce-payments'
),
mcc: __(
'Please provide a type of goods or services',
'woocommerce-payments'
),
},
placeholders: {
country: __(
Expand Down
9 changes: 6 additions & 3 deletions client/onboarding/test/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ describe( 'useValidation', () => {
} );

it( 'uses a generic string for a non existing error', () => {
const { result } = renderHook( () => useValidation( 'country' ), {
wrapper: OnboardingContextProvider,
} );
const { result } = renderHook(
() => useValidation( 'annual_revenue' ),
{
wrapper: OnboardingContextProvider,
}
);

act( () => result.current.validate() );

Expand Down

0 comments on commit d623ec2

Please sign in to comment.