UI - Fix Locked "Override Root Disk Size" switch (#5843)

* Fix Locked "Override Root Disk Size" switch

* fixes ut
This commit is contained in:
Hoang Nguyen 2022-01-10 20:34:46 +07:00 committed by GitHub
parent 0f926b5d68
commit 4916f3c90d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1133,7 +1133,7 @@ export default {
this.vm.hostname = host.name
}
if (this.serviceOffering.rootdisksize) {
if (this.serviceOffering?.rootdisksize) {
this.vm.disksizetotalgb = this.serviceOffering.rootdisksize
} else if (this.diskSize) {
this.vm.disksizetotalgb = this.diskSize
@ -2097,6 +2097,7 @@ export default {
this.updateComputeOffering(null)
},
updateTemplateConfigurationOfferingDetails (offeringId) {
this.rootDiskSizeFixed = 0
var offering = this.serviceOffering
if (!offering || offering.id !== offeringId) {
offering = _.find(this.options.serviceOfferings, (option) => option.id === offeringId)

View File

@ -57,7 +57,11 @@ mocks = {
return option
}),
info: jest.fn((option) => {
return option
return {
message: option.message,
description: 'test-description',
duration: option.duration
}
}),
success: jest.fn((option) => {
return option