CreateImageWizard: Don't show centos on non-beta

The distinction is made by checking if the distribution contained
'rhel'. This is the same way the review page determins if it should show
a registration tab.
This commit is contained in:
Sanne Raymaekers 2022-04-22 13:33:34 +02:00
parent 94c0dbbf3f
commit 4da829ff8f
6 changed files with 100 additions and 19 deletions

View file

@ -131,7 +131,10 @@ beforeAll(() => {
}
};
}
}
},
isBeta: () => {
return true;
},
}
};
});
@ -224,6 +227,24 @@ describe('Step Image output', () => {
expect(next).toBeDisabled();
});
test('non-rhel releases on beta', async () => {
setUp();
const releaseMenu = screen.getByRole('button', {
name: /options menu/i
});
userEvent.click(releaseMenu);
await screen.findByRole('option', {
name: 'Red Hat Enterprise Linux (RHEL) 8'
});
screen.getByRole('option', {
name: 'CentOS Stream 8'
});
userEvent.click(releaseMenu);
});
});
describe('Step Upload to AWS', () => {
@ -974,9 +995,8 @@ describe('Step Review', () => {
const [ next, , ] = verifyButtons();
// This is the best way to open the menu since ddf doesn't support data-testid for the select
const releaseMenu = screen.getByRole('button', {
name: /open menu/i
name: /options menu/i
});
userEvent.click(releaseMenu);
const centos = screen.getByRole('option', {
@ -1111,7 +1131,15 @@ describe('Click through all steps', () => {
const next = screen.getByRole('button', { name: /Next/ });
// select image output
// userEvent.selectOptions(screen.getByTestId('release-select'), [ RHEL_8 ]);
const releaseMenu = screen.getByRole('button', {
name: /options menu/i
});
userEvent.click(releaseMenu);
const releaseOption = screen.getByRole('option', {
name: 'Red Hat Enterprise Linux (RHEL) 8'
});
userEvent.click(releaseOption);
screen.getByTestId('upload-aws').click();
screen.getByTestId('upload-azure').click();
screen.getByTestId('upload-google').click();