test: Cleanup OpenSCAP tests

This cleans up OpenSCAP test file, utilising helper functions we already have and updating names of test and describe blocks to be consistent throughout the test files.
This commit is contained in:
regexowl 2024-10-02 09:56:54 +02:00 committed by Michal Gold
parent 3070f55354
commit d098d25892
3 changed files with 66 additions and 162 deletions

View file

@ -87,12 +87,14 @@ export const renderEditMode = async (id: string) => {
await renderCustomRoutesWithReduxRouter(`imagewizard/${id}`, {}, routes);
};
export const goToRegistrationStep = async () => {
export const selectGuestImageTarget = async () => {
const user = userEvent.setup();
const guestImageCheckBox = await screen.findByRole('checkbox', {
name: /virtualization guest image checkbox/i,
});
const guestImageCheckBox = await screen.findByTestId('checkbox-guest-image');
await waitFor(() => user.click(guestImageCheckBox));
};
export const goToRegistrationStep = async () => {
await selectGuestImageTarget();
await clickNext();
};
@ -108,11 +110,6 @@ export const clickRegisterLater = async () => {
};
export const goToOscapStep = 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