Wizard: Add validation for kernel step

This adds validation for the Kernel step.
This commit is contained in:
regexowl 2025-01-20 12:35:48 +01:00 committed by Klara Simickova
parent 2d011c52e1
commit bfef28999d
5 changed files with 64 additions and 1 deletions

View file

@ -8,6 +8,7 @@ import {
clickBack,
clickNext,
enterBlueprintName,
getNextButton,
interceptBlueprintRequest,
openAndDismissSaveAndBuildModal,
verifyCancelButton,
@ -121,6 +122,20 @@ describe('Step Kernel', () => {
await openKernelNameOptions(kernelNameDropdown);
await screen.findByText(CUSTOM_NAME);
});
test('disable Next with invalid custom kernel name', async () => {
await renderCreateMode();
await goToKernelStep();
await selectCustomKernelName('-----------');
await screen.findByText(/Invalid format/);
const nextButton = await getNextButton();
expect(nextButton).toBeDisabled();
await clearKernelName();
expect(screen.queryByText(/Invalid format/)).not.toBeInTheDocument();
expect(nextButton).toBeEnabled();
});
});
describe('Kernel request generated correctly', () => {