mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
refactor(web): require the VMs of a built V2V migration list
This commit is contained in:
@@ -26,7 +26,7 @@ export function getV2vMigrationListStorageKey({ sourceId, poolId }: V2vMigration
|
||||
export function buildV2vMigrationList(
|
||||
{ sourceId, poolId }: V2vMigrationListKey,
|
||||
defaults: V2vDestinationDefaults,
|
||||
vms: V2vMigrationListVm[] = []
|
||||
vms: V2vMigrationListVm[]
|
||||
): V2vMigrationList {
|
||||
return { version: 1, sourceId, poolId, defaults, vms }
|
||||
}
|
||||
|
||||
@@ -3,11 +3,7 @@ import {
|
||||
getV2vMigrationListStorageKey,
|
||||
parseV2vMigrationList,
|
||||
} from '@/modules/v2v/utils/v2v-migration-list.util.ts'
|
||||
import {
|
||||
createV2vDestinationDefaults,
|
||||
createV2vMigrationList,
|
||||
createV2vMigrationListVms,
|
||||
} from '@/test/create-v2v-migration-list.ts'
|
||||
import { createV2vMigrationList, createV2vMigrationListVms } from '@/test/create-v2v-migration-list.ts'
|
||||
|
||||
const STORED_LIST = createV2vMigrationList({ vms: createV2vMigrationListVms(2) })
|
||||
|
||||
@@ -24,10 +20,8 @@ describe('getV2vMigrationListStorageKey', () => {
|
||||
})
|
||||
|
||||
describe('buildV2vMigrationList', () => {
|
||||
it('creates a list with the defaults and no VM', () => {
|
||||
const defaults = createV2vDestinationDefaults()
|
||||
|
||||
expect(buildV2vMigrationList(KEY, defaults)).toEqual({ version: 1, ...KEY, defaults, vms: [] })
|
||||
it('creates a list with the defaults and the VMs', () => {
|
||||
expect(buildV2vMigrationList(KEY, STORED_LIST.defaults, STORED_LIST.vms)).toEqual(STORED_LIST)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user