test: Add "VMware checkbox select and unselect works" test
This adds a new test to check functionality of the bug fix.
This commit is contained in:
parent
79a4e98d0e
commit
b84be929bb
2 changed files with 45 additions and 0 deletions
|
|
@ -216,6 +216,7 @@ const TargetEnvironment = () => {
|
||||||
name="vsphere-radio"
|
name="vsphere-radio"
|
||||||
aria-label="VMware vSphere radio button OVA"
|
aria-label="VMware vSphere radio button OVA"
|
||||||
id="vsphere-radio-ova"
|
id="vsphere-radio-ova"
|
||||||
|
data-testid="radio-vsphere-ova"
|
||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
Open virtualization format (.ova)
|
Open virtualization format (.ova)
|
||||||
|
|
@ -264,6 +265,7 @@ const TargetEnvironment = () => {
|
||||||
name="vsphere-radio"
|
name="vsphere-radio"
|
||||||
aria-label="VMware vSphere radio button VMDK"
|
aria-label="VMware vSphere radio button VMDK"
|
||||||
id="vsphere-radio-vmdk"
|
id="vsphere-radio-vmdk"
|
||||||
|
data-testid="radio-vsphere-vmdk"
|
||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
Virtual disk (.vmdk)
|
Virtual disk (.vmdk)
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,12 @@ const selectGuestImageTarget = async () => {
|
||||||
await waitFor(() => user.click(guestImageCheckBox));
|
await waitFor(() => user.click(guestImageCheckBox));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const selectVMwareTarget = async () => {
|
||||||
|
const user = userEvent.setup();
|
||||||
|
const vmwareImageCheckBox = await screen.findByTestId('checkbox-vmware');
|
||||||
|
await waitFor(() => user.click(vmwareImageCheckBox));
|
||||||
|
};
|
||||||
|
|
||||||
const goToReviewStep = async () => {
|
const goToReviewStep = async () => {
|
||||||
await clickNext();
|
await clickNext();
|
||||||
await clickRegisterLater();
|
await clickRegisterLater();
|
||||||
|
|
@ -255,6 +261,43 @@ describe('Step Image output', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('VMware checkbox select and unselect works', async () => {
|
||||||
|
await renderCreateMode();
|
||||||
|
await selectVMwareTarget();
|
||||||
|
|
||||||
|
let vmwareCheckbox = await screen.findByTestId('checkbox-vmware');
|
||||||
|
let ovaFileRadio = await screen.findByTestId('radio-vsphere-ova');
|
||||||
|
let vmdkFileRadio = await screen.findByTestId('radio-vsphere-vmdk');
|
||||||
|
|
||||||
|
expect(await screen.findByTestId('checkbox-vmware')).toBeChecked();
|
||||||
|
expect(ovaFileRadio).toBeChecked();
|
||||||
|
expect(vmdkFileRadio).not.toBeChecked();
|
||||||
|
|
||||||
|
// switch to VMDK
|
||||||
|
user.click(vmdkFileRadio);
|
||||||
|
|
||||||
|
// refresh values
|
||||||
|
vmwareCheckbox = await screen.findByTestId('checkbox-vmware');
|
||||||
|
ovaFileRadio = await screen.findByTestId('radio-vsphere-ova');
|
||||||
|
vmdkFileRadio = await screen.findByTestId('radio-vsphere-vmdk');
|
||||||
|
|
||||||
|
expect(vmwareCheckbox).toBeChecked();
|
||||||
|
expect(ovaFileRadio).not.toBeChecked();
|
||||||
|
expect(vmdkFileRadio).toBeChecked();
|
||||||
|
|
||||||
|
// unselect VMware
|
||||||
|
user.click(vmwareCheckbox);
|
||||||
|
|
||||||
|
// refresh values
|
||||||
|
vmwareCheckbox = await screen.findByTestId('checkbox-vmware');
|
||||||
|
ovaFileRadio = await screen.findByTestId('radio-vsphere-ova');
|
||||||
|
vmdkFileRadio = await screen.findByTestId('radio-vsphere-vmdk');
|
||||||
|
|
||||||
|
expect(vmwareCheckbox).not.toBeChecked();
|
||||||
|
expect(ovaFileRadio).not.toBeChecked();
|
||||||
|
expect(vmdkFileRadio).not.toBeChecked();
|
||||||
|
});
|
||||||
|
|
||||||
test('revisit step button on Review works', async () => {
|
test('revisit step button on Review works', async () => {
|
||||||
await renderCreateMode();
|
await renderCreateMode();
|
||||||
await selectGuestImageTarget();
|
await selectGuestImageTarget();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue