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).
This commit is contained in:
rcourtman
2026-05-08 20:01:15 +01:00
parent 8fd20f2222
commit 9bb82202cf
@@ -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);