mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 12:15:42 +00:00
Re-pin frontend tests to the Patrol typed-action vocabulary
The Patrol lifecycle work renamed the queued-fix copy (Review fix -> Recover action, proposed fix -> typed action, and the waiting-for- approval summaries) and reshaped ApprovalSection's badge constant, but the unit tests still asserted the old strings and identifiers, leaving build-and-test red on main since last night. Expectations now match the shipped source. ApprovalSection kept MetadataBadge and shared Button variants, so the primitive guardrails re-pin to its current shape (BADGE_PROPS, no warningSolid variant) rather than flagging a real regression.
This commit is contained in:
@@ -1363,7 +1363,7 @@ describe('aiFindingPresentation', () => {
|
||||
),
|
||||
).toMatchObject({
|
||||
stage: 'approval',
|
||||
label: 'Review fix',
|
||||
label: 'Recover action',
|
||||
tone: 'warning',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2506,7 +2506,7 @@ describe('shared primitive guardrails', () => {
|
||||
expect(approvalBannerSource).toContain('APPROVAL_BANNER_BADGE_PROPS');
|
||||
expect(approvalBannerSource).not.toContain('firstApprovalRisk()!.badgeClass');
|
||||
expect(approvalSectionSource).toContain('MetadataBadge');
|
||||
expect(approvalSectionSource).toContain('APPROVAL_SECTION_BADGE_PROPS');
|
||||
expect(approvalSectionSource).toContain('BADGE_PROPS');
|
||||
expect(approvalSectionSource).not.toContain('approvalRisk.badgeClass');
|
||||
expect(approvalSectionSource).not.toContain('fixRisk.badgeClass');
|
||||
expect(findingsPanelSource).toContain('MetadataBadge');
|
||||
@@ -3377,7 +3377,6 @@ describe('shared primitive guardrails', () => {
|
||||
expect(approvalSectionSource).toContain('@/components/shared/Button');
|
||||
expect(approvalSectionSource).toContain('<Button');
|
||||
expect(approvalSectionSource).toContain('variant="success"');
|
||||
expect(approvalSectionSource).toContain('variant="warningSolid"');
|
||||
expect(approvalSectionSource).toContain('variant="primary"');
|
||||
expect(approvalSectionSource).toContain('variant="ghost"');
|
||||
expect(approvalSectionSource).not.toContain('px-3 py-1.5 bg-green-600 hover:bg-green-700');
|
||||
|
||||
@@ -644,12 +644,12 @@ describe('getFindingPatrolWorkflowPresentation', () => {
|
||||
expect(result?.stage).toBe('recorded');
|
||||
});
|
||||
|
||||
it('returns the approval stage with "Review fix" for fix_queued without a live approval', () => {
|
||||
it('returns the approval stage with "Recover action" for fix_queued without a live approval', () => {
|
||||
const result = getFindingPatrolWorkflowPresentation(
|
||||
makeFinding({ id: 'f1', source: 'ai-patrol', status: 'active', resourceId: 'vm:1', investigationOutcome: 'fix_queued' }),
|
||||
);
|
||||
expect(result?.stage).toBe('approval');
|
||||
expect(result?.label).toBe('Review fix');
|
||||
expect(result?.label).toBe('Recover action');
|
||||
});
|
||||
|
||||
it('returns the verification stage for fix_executed', () => {
|
||||
@@ -740,7 +740,7 @@ describe('getPatrolFindingVerificationSummary (via getPatrolFindingRowScaffold)'
|
||||
|
||||
it('reports waiting-for-approval for fix_queued', () => {
|
||||
expect(verificationValue({ investigationOutcome: 'fix_queued' })).toBe(
|
||||
'Waiting for approval before any fix runs.',
|
||||
'Waiting for the governed action record before any change runs.',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -853,15 +853,15 @@ describe('getPatrolFindingWorkflowSummary (via getPatrolFindingRowScaffold)', ()
|
||||
expect(
|
||||
workflowValue({ id: 'f1' }, [liveApproval('f1')]),
|
||||
).toBe(
|
||||
'Review evidence first; no change runs until the proposed fix is approved, then Patrol verifies the outcome.',
|
||||
'Review evidence first; no change runs until the typed action is approved, then Patrol verifies the outcome.',
|
||||
);
|
||||
});
|
||||
|
||||
it('returns the recover-queued-fix message for fix_queued without a live approval (Review fix stage)', () => {
|
||||
it('returns the recover-queued-fix message for fix_queued without a live approval (Recover action stage)', () => {
|
||||
expect(
|
||||
workflowValue({ investigationOutcome: 'fix_queued' }),
|
||||
).toBe(
|
||||
'Recover the queued fix before any action can run, then verify the outcome after a decision.',
|
||||
'Recover the queued action before any change can run, then verify the outcome after a decision.',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ describe('getPatrolFindingRowScaffold', () => {
|
||||
id: 'workflow',
|
||||
label: 'Safe workflow',
|
||||
value:
|
||||
'Review evidence first; no change runs until the proposed fix is approved, then Patrol verifies the outcome.',
|
||||
'Review evidence first; no change runs until the typed action is approved, then Patrol verifies the outcome.',
|
||||
});
|
||||
expect(
|
||||
getPatrolFindingRowScaffold(
|
||||
@@ -196,7 +196,7 @@ describe('getPatrolFindingRowScaffold', () => {
|
||||
).toContainEqual({
|
||||
id: 'verification',
|
||||
label: 'Verification',
|
||||
value: 'Waiting for approval before any fix runs.',
|
||||
value: 'Waiting for the governed action record before any change runs.',
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -2055,7 +2055,7 @@ describe('frontend resource type boundaries', () => {
|
||||
expect(approvalBannerSource).toContain('APPROVAL_BANNER_BADGE_PROPS');
|
||||
expect(approvalBannerSource).not.toContain('firstApprovalRisk()!.badgeClass');
|
||||
expect(approvalSectionSource).toContain('MetadataBadge');
|
||||
expect(approvalSectionSource).toContain('APPROVAL_SECTION_BADGE_PROPS');
|
||||
expect(approvalSectionSource).toContain('BADGE_PROPS');
|
||||
expect(approvalSectionSource).not.toContain('approvalRisk.badgeClass');
|
||||
expect(approvalSectionSource).not.toContain('fixRisk.badgeClass');
|
||||
expect(securityWarningSource).not.toContain('bg-red-50 dark:bg-red-900');
|
||||
|
||||
Reference in New Issue
Block a user