Skip to content

Commit

Permalink
test: Update EditImageWizard test file for vitest
Browse files Browse the repository at this point in the history
This adds mocks and imports needed to make the newly added EditImageWizard test file pass with vitest.
  • Loading branch information
regexowl committed Jul 12, 2024
1 parent fdf3ccb commit 759f956
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/test/Components/CreateImageWizardV2/EditImageWizard.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '@testing-library/jest-dom';
import { screen, within } from '@testing-library/react';

import { renderEditMode } from './wizardTestUtils';
Expand All @@ -7,26 +8,23 @@ import {
mockBlueprintNames,
} from '../../fixtures/blueprints';

jest.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
vi.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
useChrome: () => ({
auth: {
getUser: () => {
return {
identity: {
internal: {
org_id: 5,
},
},
};
},
},
isBeta: () => true,
isProd: () => true,
getEnvironment: () => 'prod',
}),
}));

vi.mock('@unleash/proxy-client-react', () => ({
useUnleashContext: () => vi.fn(),
useFlag: vi.fn(() => false),
}));

describe('EditImageWizard', () => {
beforeEach(() => {
vi.clearAllMocks();
});
test('should enable all navigation items in edit mode', async () => {
const id = mockBlueprintIds['darkChocolate'];
const name = mockBlueprintNames['darkChocolate'];
Expand Down

0 comments on commit 759f956

Please sign in to comment.