test: Update tests

This commit is contained in:
regexowl 2025-04-01 14:11:18 +02:00 committed by Klara Simickova
parent 698037a0ae
commit 3953c397dd
5 changed files with 23 additions and 27 deletions

View file

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

View file

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

View file

@ -60,9 +60,7 @@ const goToReviewStep = async () => {
const selectPolicy = async () => {
const user = userEvent.setup();
const policyMenu = await screen.findByRole('button', {
name: /options menu/i,
});
const policyMenu = await screen.findByText('None');
await waitFor(() => user.click(policyMenu));
const cisl2 = await screen.findByRole('option', {

View file

@ -53,9 +53,9 @@ const selectWslTarget = async () => {
const selectProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByRole('textbox', {
name: /select a profile/i,
});
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
await waitFor(() => user.click(selectProfileDropdown));
const cis1Profile = await screen.findByText(
@ -66,9 +66,9 @@ const selectProfile = async () => {
const selectDifferentProfile = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByRole('textbox', {
name: /select a profile/i,
});
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
await waitFor(() => user.click(selectProfileDropdown));
const cis2Profile = await screen.findByText(
@ -79,9 +79,9 @@ const selectDifferentProfile = async () => {
const selectNone = async () => {
const user = userEvent.setup();
const selectProfileDropdown = await screen.findByRole('textbox', {
name: /select a profile/i,
});
const selectProfileDropdown = await screen.findByPlaceholderText(
/select a profile/i
);
await waitFor(() => user.click(selectProfileDropdown));
await waitFor(async () => user.click(await screen.findByText(/none/i)));
@ -182,9 +182,9 @@ describe('Step OpenSCAP', () => {
await screen.findByText(
/OpenSCAP profiles are not compatible with WSL images/i
);
expect(
await screen.findByRole('textbox', { name: /select a profile/i })
).toBeDisabled();
expect(await screen.findByTestId('profileSelect')).toHaveClass(
'pf-m-disabled'
);
});
test('alert displayed and OpenSCAP dropdown enabled when targets include WSL', async () => {
@ -197,9 +197,7 @@ describe('Step OpenSCAP', () => {
/OpenSCAP profiles are not compatible with WSL images/i
);
await waitFor(() => {
expect(
screen.getByRole('textbox', { name: /select a profile/i })
).toBeEnabled();
expect(screen.getByPlaceholderText(/select a profile/i)).toBeEnabled();
});
});

View file

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