From a4346f2e933b9ee4c1c3148d71534faa2a080d51 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Fri, 8 May 2026 21:59:40 +0100 Subject: [PATCH] Move resolveAlertTargetType boundary to alertAssistantHandoffModel The boundary test asserted that InvestigateAlertButton owned the resolveAlertTargetType call. The button has been refactored to delegate to buildAlertAssistantHandoff, and the handoff model now owns that boundary. Update the assertion to follow. Note: the same test block still has unrelated failing assertions about FindingsPanel.tsx accessing finding.investigationSessionId and finding.status === 'resolved' directly rather than through the documented status helpers. That is real implementation drift and needs a separate FindingsPanel cleanup pass; not bundled here so the boundary delta stays scoped. --- .../__tests__/frontendResourceTypeBoundaries.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts index 8d8405ef6..a47c7a94b 100644 --- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts +++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts @@ -6,6 +6,7 @@ import reportingResourceTypesSource from '@/components/Settings/reportingResourc import reportingResourceTypesUtilSource from '@/utils/reportingResourceTypes.ts?raw'; import chartsApiSource from '@/api/charts.ts?raw'; import investigateAlertButtonSource from '@/components/Alerts/InvestigateAlertButton.tsx?raw'; +import alertAssistantHandoffModelSource from '@/components/Alerts/alertAssistantHandoffModel.ts?raw'; import alertTargetTypesSource from '@/utils/alertTargetTypes.ts?raw'; import resourceBadgesSource from '@/components/Infrastructure/resourceBadges.ts?raw'; import commandPaletteModalSource from '@/components/shared/CommandPaletteModal.tsx?raw'; @@ -662,8 +663,13 @@ describe('frontend resource type boundaries', () => { "guestTypes?: Record", ); - expect(investigateAlertButtonSource).toContain('resolveAlertTargetType'); + // resolveAlertTargetType moved from InvestigateAlertButton into the + // alert handoff model when the button was refactored to delegate via + // buildAlertAssistantHandoff. The button no longer reaches into the + // canonical resolver directly; the model owns that boundary. + expect(alertAssistantHandoffModelSource).toContain('resolveAlertTargetType'); expect(investigateAlertButtonSource).not.toContain('canonicalizeFrontendResourceType'); + expect(alertAssistantHandoffModelSource).not.toContain('canonicalizeFrontendResourceType'); expect(alertTargetTypesSource).toContain('canonicalizeFrontendResourceType'); expect(resourceBadgesSource).toContain('@/utils/resourceBadgePresentation'); expect(resourceBadgePresentationSource).toContain('getResourceTypePresentation');