CreateImageWizard: Make target environments keyboard selectable

The AWS, Google, and Azure tiles on the image output step can now be
selected/deselected using SPACE and/or ENTER.
This commit is contained in:
lucasgarfield 2022-03-10 18:12:27 +01:00 committed by jkozol
parent e649e5c385
commit e99b7b7d0b
2 changed files with 26 additions and 0 deletions

View file

@ -1499,4 +1499,21 @@ describe('Keyboard accessibility', () => {
userEvent.keyboard('{enter}');
screen.getByText('Image name');
});
test('target environment tiles are keyboard selectable', async () => {
const testTile = (tile) => {
tile.focus();
userEvent.keyboard('{space}');
expect(tile).toHaveClass('pf-m-selected');
userEvent.keyboard('{space}');
expect(tile).not.toHaveClass('pf-m-selected');
};
setUp();
clickNext();
testTile(screen.getByTestId('upload-aws'));
testTile(screen.getByTestId('upload-google'));
testTile(screen.getByTestId('upload-azure'));
});
});