mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
test(web): use the shared id of another pool in the V2V VMs step tests
This commit is contained in:
@@ -5,7 +5,7 @@ import { useV2vVmsStep } from '@/modules/v2v/composables/use-v2v-vms-step.compos
|
||||
import type { V2vMigrationList } from '@/modules/v2v/types/v2v-migration-list.type.ts'
|
||||
import type { FrontXoVm } from '@/modules/vm/remote-resources/use-xo-vm-collection.ts'
|
||||
import { createNetwork } from '@/test/create-network.ts'
|
||||
import { createPool, DISKOR_POOL_NAME } from '@/test/create-pool.ts'
|
||||
import { createPool, DISKOR_POOL_NAME, OTHER_POOL_ID } from '@/test/create-pool.ts'
|
||||
import { createSr } from '@/test/create-sr.ts'
|
||||
import { createV2vConnection } from '@/test/create-v2v-connection.ts'
|
||||
import { createV2vImportVm } from '@/test/create-v2v-import-vm.ts'
|
||||
@@ -53,7 +53,7 @@ const LIST_IDS = getV2vVmIds(LIST.vms)
|
||||
|
||||
const POOL = createPool({ id: LIST.poolId, name_label: DISKOR_POOL_NAME })
|
||||
|
||||
const OTHER_POOL = createPool({ id: 'pool-other' as FrontXoPool['id'], name_label: 'pool other' })
|
||||
const OTHER_POOL = createPool({ id: OTHER_POOL_ID, name_label: 'pool other' })
|
||||
|
||||
const SR = createSr({ id: LIST.defaults.sr, name_label: 'sr-nvme-01' })
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { FrontXoPool } from '@/modules/pool/remote-resources/use-xo-pool-collection.ts'
|
||||
import { useV2vSourceAndDestination } from '@/modules/v2v/composables/use-v2v-source-and-destination.composable.ts'
|
||||
import { createPool, DISKOR_POOL_NAME, UNKNOWN_POOL_ID } from '@/test/create-pool.ts'
|
||||
import { createPool, DISKOR_POOL_NAME, OTHER_POOL_ID, UNKNOWN_POOL_ID } from '@/test/create-pool.ts'
|
||||
import { createV2vConnection } from '@/test/create-v2v-connection.ts'
|
||||
import { xoCollectionsMock } from '@/test/mock-xo-collections.ts'
|
||||
import { mountComposable } from '@/test/mount-composable.ts'
|
||||
@@ -14,7 +14,7 @@ vi.mock(
|
||||
|
||||
const POOL = createPool({ name_label: DISKOR_POOL_NAME })
|
||||
|
||||
const OTHER_POOL = createPool({ id: 'pool-other' as FrontXoPool['id'], name_label: 'pool other' })
|
||||
const OTHER_POOL = createPool({ id: OTHER_POOL_ID, name_label: 'pool other' })
|
||||
|
||||
const CONNECTION = createV2vConnection()
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import type { FrontXoPool } from '@/modules/pool/remote-resources/use-xo-pool-collection.ts'
|
||||
import { useV2vVmLabels } from '@/modules/v2v/composables/use-v2v-vm-labels.composable.ts'
|
||||
import type { V2vSelectedVmCheck } from '@/modules/v2v/types/v2v-selected-vm.type.ts'
|
||||
import type { V2vUnsupportedReason, V2vVmStatus } from '@/modules/v2v/types/v2v-vm-row.type.ts'
|
||||
import { DISKOR_POOL_NAME } from '@/test/create-pool.ts'
|
||||
import { DISKOR_POOL_NAME, OTHER_POOL_ID } from '@/test/create-pool.ts'
|
||||
import { mountComposableWithI18n } from '@/test/mount-composable.ts'
|
||||
import { V2V_VM_POWER_STATE } from '@vates/types'
|
||||
|
||||
@@ -136,8 +135,6 @@ describe('getKindTag', () => {
|
||||
})
|
||||
|
||||
describe('getCheckInfo', () => {
|
||||
const OTHER_POOL_ID = 'pool-other' as FrontXoPool['id']
|
||||
|
||||
it.each([
|
||||
['a ready', { type: 'ready', level: 'ready' }, 'ready', 'success'],
|
||||
['a missing', { type: 'not-found', level: 'blocking' }, 'v2v:not-found-in-source', 'danger'],
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import type { FrontXoPool } from '@/modules/pool/remote-resources/use-xo-pool-collection.ts'
|
||||
import type { V2vVmRow } from '@/modules/v2v/types/v2v-vm-row.type.ts'
|
||||
import { getV2vMappingSummary, getV2vSelectedVmState } from '@/modules/v2v/utils/v2v-selected-vm.util.ts'
|
||||
import { OTHER_POOL_ID } from '@/test/create-pool.ts'
|
||||
import { createV2vImportVm } from '@/test/create-v2v-import-vm.ts'
|
||||
import { createV2vDisk, createV2vNic, createV2vVm } from '@/test/create-v2v-inventory.ts'
|
||||
import { createV2vVmRow } from '@/test/create-v2v-vm-row.ts'
|
||||
|
||||
const LIST_POOL_ID = 'pool-list' as FrontXoPool['id']
|
||||
|
||||
const OTHER_POOL_ID = 'pool-other' as FrontXoPool['id']
|
||||
|
||||
const TARGET_NAMES = { srName: 'sr-nvme-01', networkName: 'VLAN 10' }
|
||||
|
||||
function createWarmRow(poolId: FrontXoPool['id'], overrides: Partial<V2vVmRow> = {}) {
|
||||
|
||||
@@ -6,13 +6,13 @@ export const DISKOR_POOL_NAME = 'pool diskor'
|
||||
// A pool id no pool collection knows: removed, or of another XO
|
||||
export const UNKNOWN_POOL_ID = 'pool-unknown' as FrontXoPool['id']
|
||||
|
||||
// A pool id distinct from the `createPool()` one, for the resources of another pool
|
||||
export const OTHER_POOL_ID = 'pool-2' as FrontXoPool['id']
|
||||
|
||||
/**
|
||||
* Builds a fully-populated `FrontXoPool` for use in tests. Pass `overrides` to
|
||||
* tweak only the fields relevant to the case under test.
|
||||
*/
|
||||
// A pool id distinct from the `createPool()` one, for the resources of another pool
|
||||
export const OTHER_POOL_ID = 'pool-2' as FrontXoPool['id']
|
||||
|
||||
export function createPool(overrides: Partial<FrontXoPool> = {}): FrontXoPool {
|
||||
return {
|
||||
id: 'pool-789' as FrontXoPool['id'],
|
||||
|
||||
Reference in New Issue
Block a user