test(web): use the shared list pool in the V2V pool name test

This commit is contained in:
Olivier Floch
2026-11-09 11:57:47 +01:00
parent f8dc85855b
commit 7ec1e941a5

View File

@@ -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)
})