From 7351634cf0c9d09e5b8256e216a23776ac73ab56 Mon Sep 17 00:00:00 2001 From: Yury Saukou Date: Mon, 9 Dec 2024 21:55:26 +0400 Subject: [PATCH] update tests --- .../useSelectedOrganizationVersion.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Organizations/OrganizationVersion/hooks/useSelectedOrganizationVersion/useSelectedOrganizationVersion.test.js b/src/Organizations/OrganizationVersion/hooks/useSelectedOrganizationVersion/useSelectedOrganizationVersion.test.js index 73809bb2..cbcc6484 100644 --- a/src/Organizations/OrganizationVersion/hooks/useSelectedOrganizationVersion/useSelectedOrganizationVersion.test.js +++ b/src/Organizations/OrganizationVersion/hooks/useSelectedOrganizationVersion/useSelectedOrganizationVersion.test.js @@ -19,6 +19,7 @@ import { organizationAuditEvent } from 'fixtures'; import { useContactsByIds, useInterfacesByIds, + useTypes, } from '../../../../common/hooks'; import { useSelectedOrganizationVersion } from './useSelectedOrganizationVersion'; @@ -33,6 +34,7 @@ jest.mock('../../../../common/hooks', () => ({ ...jest.requireActual('../../../../common/hooks'), useContactsByIds: jest.fn(), useInterfacesByIds: jest.fn(), + useTypes: jest.fn(), })); const versionId = organizationAuditEvent.id; @@ -43,6 +45,10 @@ const contacts = [{ id: 'contact1' }]; const interfaces = [{ id: 'interface1' }]; const organization = { id: 'org1' }; const users = [{ id: 'user1', personal: { firstName: 'John', lastName: 'Doe' } }]; +const organizationTypes = [{ + id: 'e7e9af00-c12c-448f-8ad1-d15ff209605a', + name: 'Type name', +}]; const queryClient = new QueryClient(); const wrapper = ({ children }) => ( @@ -58,6 +64,7 @@ describe('useSelectedOrganizationVersion', () => { useUsersBatch.mockReturnValue({ users, isLoading: false }); useContactsByIds.mockReturnValue({ contacts, isLoading: false }); useInterfacesByIds.mockReturnValue({ interfaces, isLoading: false }); + useTypes.mockReturnValue({ organizationTypes, isLoading: false }); }); afterEach(() => { @@ -81,6 +88,7 @@ describe('useSelectedOrganizationVersion', () => { acqUnits: '', contactsList: contacts, interfacesList: interfaces, + organizationTypesResolved: 'Type name', vendorCurrenciesValue: 'US Dollar (USD)', metadata: getVersionMetadata(organizationAuditEvent, organization), });