V2Wizard: Enable GCP tests

All tests passing except when required to move to registration step as
it has not been implemented yet.
This commit is contained in:
lucasgarfield 2024-01-12 18:01:30 +01:00 committed by Klara Simickova
parent ce23667833
commit 3ed2192358

View file

@ -455,25 +455,25 @@ describe('Step Upload to Google', () => {
});
};
test('clicking Next loads Registration', async () => {
await setUp();
// test('clicking Next loads Registration', async () => {
// await setUp();
const shareRadioButton = await screen.findByRole('radio', {
name: /share image with a google account/i,
});
await user.click(shareRadioButton);
// const shareRadioButton = await screen.findByRole('radio', {
// name: /share image with a google account/i,
// });
// await user.click(shareRadioButton);
const googleEmailInput = await screen.findByTestId('input-google-email');
// const googleEmailInput = await screen.findByTestId('input-google-email');
await user.type(googleEmailInput, 'test@test.com');
await clickNext();
// await user.type(googleEmailInput, 'test@test.com');
// await clickNext();
await screen.findByRole('textbox', {
name: 'Select activation key',
});
// await screen.findByRole('textbox', {
// name: 'Select activation key',
// });
screen.getByText('Automatically register and enable advanced capabilities');
});
// screen.getByText('Automatically register and enable advanced capabilities');
// });
test('clicking Back loads Release', async () => {
await setUp();
@ -492,24 +492,18 @@ describe('Step Upload to Google', () => {
test('the google account id field is shown and required', async () => {
await setUp();
await waitFor(() => {
screen.getByTestId('account-sharing');
});
await user.click(screen.getByTestId('account-sharing'));
const accessKeyId = await screen.findByTestId('input-google-email');
expect(accessKeyId).toHaveValue('');
expect(accessKeyId).toBeEnabled();
const principalInput = await screen.findByTestId('principal');
expect(principalInput).toHaveValue('');
expect(principalInput).toBeEnabled();
});
test('the google email field must be a valid email', async () => {
await setUp();
await user.click(screen.getByTestId('account-sharing'));
await user.type(screen.getByTestId('input-google-email'), 'a');
await user.type(await screen.findByTestId('principal'), 'a');
expect(await getNextButton()).toHaveClass('pf-m-disabled');
expect(await getNextButton()).toBeDisabled();
await user.type(screen.getByTestId('input-google-email'), 'test@test.com');
await user.type(await screen.findByTestId('principal'), 'test@test.com');
expect(await getNextButton()).not.toHaveClass('pf-m-disabled');
expect(await getNextButton()).toBeEnabled();
});