Files
pipelines/app/test/features/runs/actions/decision_exhausted_test.dart
T
alan ebe79ebed0 App: findings ledger tab, retry extra visits and exhaustion decisions
Run detail gains a Findings tab (open-count badge) listing the server's
findings ledger with status and minimum-severity filters and expandable
event history; visit grants show as an Extra visits summary fact. The
resume retry prompt can grant 1-5 extra visits to the exhausted stage or a
chosen graph stage (never sent on restart), suggested when the run failed
on a visit limit. A loop-exhaustion decision waiting on a model stage is
now decidable from its recorded options, with readable labels, targets and
the visit count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:45:51 +00:00

60 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/actions/decision_action.dart';
import 'package:pipelines_app/features/runs/actions/decision_wording.dart';
import '../domain/run_exhausted_decision_fixture.dart';
import 'retry_test_support.dart' show FakeRetryGateway;
void main() {
testWidgets('an exhaustion decision shows readable options and the visit '
'count, and sends the option key for the exhausted stage', (
tester,
) async {
final gateway = FakeRetryGateway(
(type, fields) async => {
'run_detail': {...exhaustedDecisionRun(), 'status': 'running'},
},
);
final changed = <JsonMap>[];
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Center(
child: HumanDecisionAction(
run: exhaustedDecisionRun(),
gateway: gateway,
onRunChanged: changed.add,
),
),
),
),
);
await tester.tap(find.byKey(decisionActionKey));
await tester.pumpAndSettle();
expect(find.text('Accept as is'), findsOneWidget);
expect(find.text('One more round'), findsOneWidget);
expect(find.text('Abort'), findsOneWidget);
expect(find.text('→ implement'), findsOneWidget);
expect(
find.text('review reached its visit limit: visit 3 of 3'),
findsOneWidget,
);
await tester.tap(find.text('One more round'));
await tester.pump();
await tester.tap(find.text(decisionConfirmLabel));
await tester.pumpAndSettle();
final decide = gateway.calls.singleWhere((c) => c.type == 'decide_run');
expect(decide.fields, {
'run_id': 9,
'option': 'continue',
'stage': 'review',
});
expect(changed, isNotEmpty);
});
}