From 9bb82202cf8f775fa040b0b0067dd38b7fb11b42 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 8 May 2026 20:01:15 +0100 Subject: [PATCH] Align infrastructurePageModel sourceOptions to canonical order The two failing assertions hardcoded sourceOptions with proxmox-pve first, but buildSourcePlatformOptions sorts by DEFAULT_INFRASTRUCTURE_SOURCE_ORDER from platformSupportManifest: agent, truenas, proxmox-pve, proxmox-pbs, proxmox-pmg, docker, kubernetes. Reorder the expected arrays to match (agent before proxmox-pve in the present-source case, truenas before proxmox-pve in the route-owned case). --- .../__tests__/infrastructurePageModel.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts index 84ddb8817..62f26fd7f 100644 --- a/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts +++ b/frontend-modern/src/features/infrastructure/__tests__/infrastructurePageModel.test.ts @@ -37,9 +37,11 @@ describe('infrastructurePageModel', () => { const derivation = buildInfrastructurePageFilterDerivation(resources, '', '', ''); expect(Array.from(derivation.availableSources)).toEqual(['agent', 'proxmox-pve']); + // sourceOptions follow DEFAULT_INFRASTRUCTURE_SOURCE_ORDER from the + // platform manifest: agent, truenas, proxmox-pve, ... expect(derivation.sourceOptions).toEqual([ - { key: 'proxmox-pve', label: 'PVE' }, { key: 'agent', label: 'Agent' }, + { key: 'proxmox-pve', label: 'PVE' }, ]); expect(derivation.statusOptions).toEqual([ { key: 'online', label: 'Online' }, @@ -111,9 +113,10 @@ describe('infrastructurePageModel', () => { ); expect(Array.from(derivation.availableSources)).toEqual(['proxmox-pve']); + // truenas precedes proxmox-pve in DEFAULT_INFRASTRUCTURE_SOURCE_ORDER. expect(derivation.sourceOptions).toEqual([ - { key: 'proxmox-pve', label: 'PVE' }, { key: 'truenas', label: 'TrueNAS' }, + { key: 'proxmox-pve', label: 'PVE' }, ]); expect(derivation.activeFilterCount).toBe(1); expect(derivation.hasActiveFilters).toBe(true);