-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds foundation for Kernel step, including gating and basic tests.
- Loading branch information
Showing
22 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Components/CreateImageWizard/steps/Kernel/components/KernelArguments.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
import { FormGroup } from '@patternfly/react-core'; | ||
|
||
const KernelArguments = () => { | ||
return <FormGroup isRequired={false} label="Append"></FormGroup>; | ||
}; | ||
|
||
export default KernelArguments; |
9 changes: 9 additions & 0 deletions
9
src/Components/CreateImageWizard/steps/Kernel/components/KernelName.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
import { FormGroup } from '@patternfly/react-core'; | ||
|
||
const KernelName = () => { | ||
return <FormGroup isRequired={false} label="Name"></FormGroup>; | ||
}; | ||
|
||
export default KernelName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
|
||
import { Text, Form, Title } from '@patternfly/react-core'; | ||
|
||
import KernelArguments from './components/KernelArguments'; | ||
import KernelName from './components/KernelName'; | ||
|
||
const KernelStep = () => { | ||
return ( | ||
<Form> | ||
<Title headingLevel="h1" size="xl"> | ||
Kernel | ||
</Title> | ||
<Text>Customize kernel name and kernel arguments.</Text> | ||
<KernelName /> | ||
<KernelArguments /> | ||
</Form> | ||
); | ||
}; | ||
|
||
export default KernelStep; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/test/Components/CreateImageWizard/steps/Kernel/Kernel.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters