diff --git a/web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts b/web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts index e83f5510b1..7259d0f41e 100644 --- a/web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts +++ b/web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts @@ -20,6 +20,7 @@ type MockInternalBootSelection = { type InternalBootVm = { poolMode: 'dedicated' | 'hybrid'; + selectedDevices: Array; getDeviceSelectItems: (index: number) => Array<{ value: string; label: string; disabled?: boolean }>; }; @@ -511,6 +512,8 @@ describe('OnboardingInternalBootStep', () => { expect(vm.getDeviceSelectItems(0)).toEqual( expect.arrayContaining([expect.objectContaining({ value: 'DEDICATED-6GIB' })]) ); + vm.selectedDevices[0] = 'DEDICATED-6GIB'; + await flushPromises(); vm.poolMode = 'hybrid'; await flushPromises(); @@ -518,6 +521,7 @@ describe('OnboardingInternalBootStep', () => { expect(vm.getDeviceSelectItems(0)).not.toEqual( expect.arrayContaining([expect.objectContaining({ value: 'DEDICATED-6GIB' })]) ); + expect(vm.selectedDevices[0]).toBeUndefined(); await wrapper.get('[data-testid="internal-boot-eligibility-toggle"]').trigger('click'); await flushPromises(); expect(wrapper.text()).toContain('DEDICATED-6GIB - 6.4 GB (sda)'); diff --git a/web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue b/web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue index 22affa14fd..c98a994638 100644 --- a/web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue +++ b/web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue @@ -550,11 +550,17 @@ watch( ); watch(poolMode, (mode) => { + slotCount.value = 1; + selectedDevices.value = [undefined]; + updateBios.value = templateData.value?.defaultUpdateBios ?? true; + applyBootSizeSelection(templateData.value?.defaultBootSizeMiB ?? DEFAULT_BOOT_SIZE_MIB); + if (mode === 'dedicated') { poolName.value = 'boot'; - } else if (poolName.value === 'boot') { - poolName.value = templateData.value?.poolNameDefault ?? ''; + return; } + + poolName.value = templateData.value?.poolNameDefault ?? ''; }); const isDeviceDisabled = (deviceId: string, index: number) => {