From 709eeb2f7719a4e288cc6b9117d5fd708889a036 Mon Sep 17 00:00:00 2001 From: rcourtman <8825017+rcourtman@users.noreply.github.com> Date: Sat, 12 Sep 2026 18:36:06 +0100 Subject: [PATCH] Align node filter source contracts with inventory options Keep the shared-owner and memoization assertions while allowing the platform-scoped inventory argument used to preserve nodes without guests. --- .../WorkloadsSurface.performance.contract.test.tsx | 4 ++-- .../__tests__/frontendResourceTypeBoundaries.test.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx index c71532cba1..20016a56cc 100644 --- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx +++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx @@ -1227,8 +1227,8 @@ describe('Workloads performance contract', () => { expect(workloadsWorkloadRouteStateSource).toContain('WORKLOADS_WORKLOAD_ROUTE_RESET_STATE'); expect(workloadsWorkloadRouteStateSource).toContain('isWorkloadsRoute,'); expect(workloadsWorkloadFilterOptionsSource).toContain("from './workloadFilterConfigModel'"); - expect(workloadsWorkloadFilterOptionsSource).toContain( - 'buildWorkloadNodeOptions(platformScopedGuests())', + expect(workloadsWorkloadFilterOptionsSource).toMatch( + /const workloadNodeOptions = createMemo\(\(\) =>\s*buildWorkloadNodeOptions\(\s*platformScopedGuests\(\),/, ); expect(workloadsWorkloadFilterOptionsSource).not.toContain( 'const onContextChange = (value: string) =>', diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts index 7df9ac6186..35e2debb92 100644 --- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts +++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts @@ -665,9 +665,13 @@ describe('frontend resource type boundaries', () => { expect(workloadsControlsStateSource).toContain('DEFAULT_WORKLOADS_SORT_KEY'); expect(workloadsWorkloadRouteStateSource).toContain('useWorkloadFilterOptions'); expect(workloadsWorkloadFilterOptionsSource).toContain("from './workloadFilterConfigModel'"); - expect(workloadsWorkloadFilterOptionsSource).toContain( - 'buildWorkloadNodeOptions(platformScopedGuests())', + expect(workloadsWorkloadFilterOptionsSource).toMatch( + /buildWorkloadNodeOptions\(\s*platformScopedGuests\(\),/, ); + expect(workloadsWorkloadFilterOptionsSource).toContain( + "sourcePlatformScopeMatchesFilter('proxmox-pve', options.platformScope?.())", + ); + expect(workloadsWorkloadFilterOptionsSource).toContain('? (options.nodes?.() ?? [])'); expect(workloadsWorkloadFilterOptionsSource).not.toContain( 'const onContextChange = (value: string) =>', );