test: Update tests

Add mocking to tests where needed.
This commit is contained in:
regexowl 2024-08-01 17:52:36 +02:00 committed by Klara Simickova
parent d88cd216a5
commit 2febf98e93
9 changed files with 82 additions and 24 deletions

View file

@ -43,9 +43,16 @@ vi.mock('@redhat-cloud-services/frontend-components/useChrome', () => ({
vi.mock('@unleash/proxy-client-react', () => ({
useUnleashContext: () => vi.fn(),
useFlag: vi.fn((flag) =>
flag === 'image-builder.firstboot.enabled' ? true : false
),
useFlag: vi.fn((flag) => {
switch (flag) {
case 'image-builder.firstboot.enabled':
return true;
case 'image-builder.snapshots.enabled':
return true;
default:
return false;
}
}),
}));
const goToFileSystemConfigurationStep = async () => {