CreateImageWizard: improve review step

The review step is improved. The create button now states 'Create
image'. The step description text is updated. The fields to be reviewed
are now split into tabs for 'Target environment', 'Registration',
'System Configuration'. The target environments show the logo of the
environment now. The quantity of packages selected also displays now.
Tests are also updated.
This commit is contained in:
Jacob Kozol 2021-11-18 15:28:40 +01:00 committed by Tom Gundersen
parent 3be89815f4
commit 2602ff346f
3 changed files with 164 additions and 106 deletions

View file

@ -425,7 +425,7 @@ describe('Step Packages', () => {
const [ next, , ] = verifyButtons();
next.click();
screen.getByText('Review the information and click the Create button to create your image using the following criteria.');
screen.getByText('Review the information and click "Create image" to create the image using the following criteria.');
});
test('clicking Back loads Register', () => {
@ -567,6 +567,23 @@ describe('Step Review', () => {
const cancel = screen.getByRole('button', { name: /Cancel/ });
verifyCancelButton(cancel, history);
});
test('has three tabs', async () => {
const buttonTarget = screen.getByTestId('tab-target');
const buttonRegistration = screen.getByTestId('tab-registration');
const buttonSystem = screen.getByTestId('tab-system');
userEvent.click(buttonTarget);
screen.getByRole('heading', {
name: 'Amazon Web Services'
});
userEvent.click(buttonRegistration);
screen.getByText('Register the system on first boot');
userEvent.click(buttonSystem);
screen.getByRole('heading', {
name: 'Packages'
});
});
});
describe('Click through all steps', () => {
@ -624,7 +641,7 @@ describe('Click through all steps', () => {
// review
await screen.
findByText('Review the information and click the Create button to create your image using the following criteria.');
findByText('Review the information and click "Create image" to create the image using the following criteria.');
await screen.findAllByText('Amazon Web Services');
await screen.findAllByText('Google Cloud Platform');
await screen.findByText('Register the system on first boot');
@ -752,7 +769,7 @@ describe('Click through all steps', () => {
next.click();
expect(screen.queryByText(
'Review the information and click the Create button to create your image using the following criteria.'
'Review the information and click "Create image" to create the image using the following criteria.'
)).not.toBeInTheDocument();
// fill in the registration
@ -762,7 +779,7 @@ describe('Click through all steps', () => {
screen.getByRole('button', { name: /Next/ }).click();
await screen.
findByText('Review the information and click the Create button to create your image using the following criteria.');
findByText('Review the information and click "Create image" to create the image using the following criteria.');
// review
await screen.findAllByText('Amazon Web Services');
await screen.findByText('Register the system on first boot');
@ -786,7 +803,7 @@ describe('Click through all steps', () => {
screen.getByRole('button', { name: /Next/ }).click();
expect(screen.queryByText(
'Review the information and click the Create button to create your image using the following criteria.'
'Review the information and click "Create image" to create the image using the following criteria.'
)).not.toBeInTheDocument();
// fill in the registration
@ -796,7 +813,7 @@ describe('Click through all steps', () => {
screen.getByRole('button', { name: /Next/ }).click();
await screen.
findByText('Review the information and click the Create button to create your image using the following criteria.');
findByText('Review the information and click "Create image" to create the image using the following criteria.');
await screen.findAllByText('Amazon Web Services');
await screen.findByText('Register the system on first boot');
});