diff --git a/src/pages/my-ads/components/AdTypeSection/AdTypeSection.tsx b/src/pages/my-ads/components/AdTypeSection/AdTypeSection.tsx index f6af0f6b..5fe38aab 100644 --- a/src/pages/my-ads/components/AdTypeSection/AdTypeSection.tsx +++ b/src/pages/my-ads/components/AdTypeSection/AdTypeSection.tsx @@ -5,6 +5,7 @@ import { FloatingRate, RadioGroup } from '@/components'; import { BUY_SELL, RATE_TYPE } from '@/constants'; import { useQueryString } from '@/hooks/custom-hooks'; import { getValidationRules, restrictDecimalPlace } from '@/utils'; +import { useTranslations } from '@deriv-com/translations'; import { Text, useDevice } from '@deriv-com/ui'; import { AdFormController } from '../AdFormController'; import { AdFormInput } from '../AdFormInput'; @@ -24,6 +25,7 @@ type TAdTypeSectionProps = { const AdTypeSection = ({ currency, localCurrency, onCancel, rateType, ...props }: TAdTypeSectionProps) => { const { queryString } = useQueryString(); + const { localize } = useTranslations(); const { advertId = '' } = queryString; const isEdit = !!advertId; const { isMobile } = useDevice(); @@ -120,7 +122,7 @@ const AdTypeSection = ({ currency, localCurrency, onCancel, rateType, ...props } /> ); }} - rules={{ validate: getValidationRules('rate-value', getValues) }} + rules={{ validate: getValidationRules('rate-value', getValues, localize) }} /> ) : ( ({ AdFormTextArea: () =>
AdFormTextArea
, })); +jest.mock('@deriv-com/translations', () => ({ + ...jest.requireActual('@deriv-com/translations'), + useTranslations: () => ({ localize: jest.fn() }), +})); const mockSetFieldValue = jest.fn(); const mockTriggerFunction = jest.fn(); jest.mock('react-hook-form', () => ({