From 9c42770ab58763abf933943ed423abc2fa7cdef5 Mon Sep 17 00:00:00 2001 From: Siarhei Karol Date: Wed, 18 Dec 2024 13:07:53 +0300 Subject: [PATCH] update existing unit tests --- .../hooks/useComplexLookupSearchResults.ts | 2 +- .../ComplexLookupField/formatters/Assign.tsx | 6 +-- .../common/hooks/useComplexLookup.test.ts | 10 +++++ .../configs/Authorities.test.tsx | 6 +-- .../formatters/Assign.test.tsx | 45 ++++++++++++++----- 5 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/common/hooks/useComplexLookupSearchResults.ts b/src/common/hooks/useComplexLookupSearchResults.ts index 271d4351..f7b13ee1 100644 --- a/src/common/hooks/useComplexLookupSearchResults.ts +++ b/src/common/hooks/useComplexLookupSearchResults.ts @@ -30,7 +30,7 @@ export const useComplexLookupSearchResults = ({ formatMessage, onAssign: onAssignRecord, onTitleClick, - validateId: checkFailedId, + checkFailedId, }) : row[key].label, }; diff --git a/src/components/ComplexLookupField/formatters/Assign.tsx b/src/components/ComplexLookupField/formatters/Assign.tsx index ed51436b..89ee0e99 100644 --- a/src/components/ComplexLookupField/formatters/Assign.tsx +++ b/src/components/ComplexLookupField/formatters/Assign.tsx @@ -5,14 +5,14 @@ import { Button, ButtonType } from '@components/Button'; export const AssignFormatter = ({ row, onAssign, - validateId, + checkFailedId, }: { row: SearchResultsTableRow; onAssign: ({ id, title, linkedFieldValue }: ComplexLookupAssignRecordDTO) => void; - validateId: (id: string) => boolean; + checkFailedId: (id: string) => boolean; }) => { const isAuthorized = row.authorized.label === AuthRefType.Authorized; - const isDisabled = validateId(row.__meta.id); + const isDisabled = checkFailedId(row.__meta.id); return isAuthorized ? (