test: Update EditImageWizard test file for vitest

This adds mocks and imports needed to make the newly added EditImageWizard test file pass with vitest.
This commit is contained in:
regexowl 2024-07-11 11:02:41 +02:00 committed by Ondřej Ezr
parent a5f69a2559
commit 4389318de8

View file

@ -1,3 +1,4 @@
import '@testing-library/jest-dom';
import { screen, within } from '@testing-library/react';
import { renderEditMode } from './wizardTestUtils';
@ -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'];