Wizard: edit tests related to Compliance step

This commit is contained in:
Katarina Sieklova 2025-05-20 14:18:20 +02:00 committed by Klara Simickova
parent 0cfe3dde30
commit 564c5461d4
7 changed files with 15 additions and 25 deletions

View file

@ -58,9 +58,7 @@ const goToFirstBootStep = async (): Promise<void> => {
const selectSimplifiedOscapProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
const simplifiedProfile = await screen.findByText(/Simplified profile/i);

View file

@ -134,9 +134,7 @@ const removeKernelArg = async (kernelArg: string) => {
const selectProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
const cis1Profile = await screen.findByText(/Kernel append only profile/i);

View file

@ -44,7 +44,7 @@ const goToComplianceStep = async () => {
});
await waitFor(() => user.click(button));
// wait until all policies are loaded
await screen.findByText('Select a policy');
await screen.findByText('None');
};
const goToReviewStep = async () => {
@ -68,7 +68,7 @@ const goToReviewStep = async () => {
const selectPolicy = async () => {
const user = userEvent.setup();
const policyMenu = await screen.findByText('Select a policy');
const policyMenu = await screen.findByText('None');
await waitFor(() => user.click(policyMenu));
const cisl2 = await screen.findByRole('option', {

View file

@ -53,9 +53,7 @@ const selectWslTarget = async () => {
const selectProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
const cis1Profile = await screen.findByText(
@ -66,9 +64,7 @@ const selectProfile = async () => {
const selectDifferentProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
const cis2Profile = await screen.findByText(
@ -79,9 +75,7 @@ const selectDifferentProfile = async () => {
const selectNone = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
await waitFor(async () => user.click(await screen.findByText(/none/i)));
@ -197,7 +191,7 @@ describe('Step OpenSCAP', () => {
/OpenSCAP profiles are not compatible with WSL images/i
);
await waitFor(() => {
expect(screen.getByPlaceholderText(/select a profile/i)).toBeEnabled();
expect(screen.getByPlaceholderText(/none/i)).toBeEnabled();
});
});

View file

@ -108,9 +108,7 @@ const removeService = async (service: string) => {
const selectProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
const selectProfileDropdown = await screen.findByPlaceholderText(/none/i);
await waitFor(() => user.click(selectProfileDropdown));
const cis1Profile = await screen.findByText(