Skip to content

Commit

Permalink
fix: build fail issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed May 13, 2024
1 parent c14411a commit 6a7e344
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/my-ads/components/AdTypeSection/AdTypeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();
Expand Down Expand Up @@ -120,7 +122,7 @@ const AdTypeSection = ({ currency, localCurrency, onCancel, rateType, ...props }
/>
);
}}
rules={{ validate: getValidationRules('rate-value', getValues) }}
rules={{ validate: getValidationRules('rate-value', getValues, localize) }}
/>
) : (
<AdFormInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ jest.mock('../../AdFormTextArea', () => ({
AdFormTextArea: () => <div>AdFormTextArea</div>,
}));

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', () => ({
Expand Down

0 comments on commit 6a7e344

Please sign in to comment.