Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
usavkov-epam committed Dec 9, 2024
1 parent 3212eea commit 7351634
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { organizationAuditEvent } from 'fixtures';
import {
useContactsByIds,
useInterfacesByIds,
useTypes,
} from '../../../../common/hooks';
import { useSelectedOrganizationVersion } from './useSelectedOrganizationVersion';

Expand All @@ -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;
Expand All @@ -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 }) => (
Expand All @@ -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(() => {
Expand All @@ -81,6 +88,7 @@ describe('useSelectedOrganizationVersion', () => {
acqUnits: '',
contactsList: contacts,
interfacesList: interfaces,
organizationTypesResolved: 'Type name',
vendorCurrenciesValue: 'US Dollar (USD)',
metadata: getVersionMetadata(organizationAuditEvent, organization),
});
Expand Down

0 comments on commit 7351634

Please sign in to comment.