CreateImageWizard: conditionally render Registration tab

At the final review step, only render the Registration tab
if the user has selected RHEL 8 as the release. Add a test to
ensure that if the user selects CentOS as the release, there
are only two tabs at the review step.
This commit is contained in:
Chloe Kaubisch 2022-01-12 13:23:42 +01:00 committed by jkozol
parent 6d66ab3228
commit 3571c969ce
2 changed files with 55 additions and 37 deletions

View file

@ -750,7 +750,7 @@ describe('Step Review', () => {
verifyCancelButton(cancel, history);
});
test('has three tabs', async () => {
test('has three tabs for rhel', async () => {
setUp();
const buttonTarget = screen.getByTestId('tab-target');
@ -768,6 +768,23 @@ describe('Step Review', () => {
name: 'Packages'
});
});
test('has two tabs for centos', async () => {
setUpCentOS();
const buttonTarget = screen.getByTestId('tab-target');
const buttonSystem = screen.getByTestId('tab-system');
expect(screen.queryByTestId('tab-registration')).not.toBeInTheDocument();
userEvent.click(buttonTarget);
screen.getByRole('heading', {
name: 'Amazon Web Services'
});
userEvent.click(buttonSystem);
screen.getByRole('heading', {
name: 'Packages'
});
});
});
describe('Click through all steps', () => {