Wizard: Kernel step basics

This adds foundation for Kernel step, including gating and basic tests.
This commit is contained in:
regexowl 2024-12-13 14:16:47 +01:00 committed by Klara Simickova
parent 8004ed75e4
commit 8e046e3018
22 changed files with 141 additions and 4 deletions

View file

@ -0,0 +1,65 @@
import type { Router as RemixRouter } from '@remix-run/router';
import { screen, waitFor } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
import {
clickBack,
clickNext,
verifyCancelButton,
} from '../../wizardTestUtils';
import { clickRegisterLater, renderCreateMode } from '../../wizardTestUtils';
let router: RemixRouter | undefined = undefined;
const goToKernelStep = async () => {
const user = userEvent.setup();
const guestImageCheckBox = await screen.findByRole('checkbox', {
name: /virtualization guest image checkbox/i,
});
await waitFor(() => user.click(guestImageCheckBox));
await clickNext(); // Registration
await clickRegisterLater();
await clickNext(); // OpenSCAP
await clickNext(); // File system configuration
await clickNext(); // Snapshots
await clickNext(); // Custom repositories
await clickNext(); // Additional packages
await clickNext(); // Users
await clickNext(); // Timezone
await clickNext(); // Locale
await clickNext(); // Hostname
await clickNext(); // Kernel
};
describe('Step Kernel', () => {
beforeEach(() => {
vi.clearAllMocks();
router = undefined;
});
test('clicking Next loads First boot script', async () => {
await renderCreateMode();
await goToKernelStep();
await clickNext();
await screen.findByRole('heading', {
name: 'First boot configuration',
});
});
test('clicking Back loads Hostname', async () => {
await renderCreateMode();
await goToKernelStep();
await clickBack();
await screen.findByRole('heading', { name: 'Hostname' });
});
test('clicking Cancel loads landing page', async () => {
await renderCreateMode();
await goToKernelStep();
await verifyCancelButton(router);
});
});
// TO DO 'Kernel step' -> 'revisit step button on Review works'
// TO DO 'Kernel request generated correctly'
// TO DO 'Kernel edit mode'