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 aec960e
Showing 1 changed file with 4 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,7 @@ const contacts = [{ id: 'contact1' }];
const interfaces = [{ id: 'interface1' }];
const organization = { id: 'org1' };
const users = [{ id: 'user1', personal: { firstName: 'John', lastName: 'Doe' } }];
const organizationTypes = [{ id: 'type-id', name: 'Type name' }];

const queryClient = new QueryClient();
const wrapper = ({ children }) => (
Expand All @@ -58,6 +61,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 Down

0 comments on commit aec960e

Please sign in to comment.