diff --git a/@xen-orchestra/web/src/modules/v2v/composables/use-v2v-pool-name.composable.unit.test.ts b/@xen-orchestra/web/src/modules/v2v/composables/use-v2v-pool-name.composable.unit.test.ts index 6614cf23ff..7caf80585b 100644 --- a/@xen-orchestra/web/src/modules/v2v/composables/use-v2v-pool-name.composable.unit.test.ts +++ b/@xen-orchestra/web/src/modules/v2v/composables/use-v2v-pool-name.composable.unit.test.ts @@ -1,18 +1,17 @@ import { useV2vPoolName } from '@/modules/v2v/composables/use-v2v-pool-name.composable.ts' -import { createPool } from '@/test/create-pool.ts' import { xoCollectionsMock } from '@/test/mock-xo-collections.ts' import { mountComposable } from '@/test/mount-composable.ts' import { v2vConnectionProvide } from '@/test/v2v-connection-provide.ts' +import { V2V_LIST_POOL } from '@/test/v2v-wizard-fixtures.ts' vi.mock( import('@/modules/pool/remote-resources/use-xo-pool-collection.ts'), () => import('@/test/mock-xo-collections.ts') ) -const POOL = createPool() - function mountPoolName() { - return mountComposable(() => ({ poolName: useV2vPoolName(POOL.id) }), { provide: v2vConnectionProvide() }).wrapper.vm + return mountComposable(() => ({ poolName: useV2vPoolName(V2V_LIST_POOL.id) }), { provide: v2vConnectionProvide() }) + .wrapper.vm } beforeEach(() => { @@ -20,11 +19,11 @@ beforeEach(() => { }) it('names the pool', () => { - xoCollectionsMock.pools.value = [POOL] + xoCollectionsMock.pools.value = [V2V_LIST_POOL] - expect(mountPoolName().poolName).toBe(POOL.name_label) + expect(mountPoolName().poolName).toBe(V2V_LIST_POOL.name_label) }) it('names the pool by its id while the pools load', () => { - expect(mountPoolName().poolName).toBe(POOL.id) + expect(mountPoolName().poolName).toBe(V2V_LIST_POOL.id) })