Update permission card stop assertions

Keep the permission-card regression aligned with the redesigned running composer. Verify that the composer stop control is absent and Stop remains available through the More menu while the turn runs.
This commit is contained in:
2026-11-12 03:11:02 +00:00
parent 77db577cd0
commit b4701419d0
2 changed files with 29 additions and 3 deletions
@@ -38,6 +38,15 @@ JsonMap permission({
if (decision.isNotEmpty) 'decision': decision,
};
Future<void> expectStopInMoreMenu(WidgetTester tester) async {
await tester.tap(find.byTooltip('More actions').hitTestable().first);
await tester.pumpAndSettle();
expect(find.text('Stop'), findsOneWidget);
await tester.tapAt(const Offset(1, 1));
await tester.pumpAndSettle();
expect(find.text('Stop'), findsNothing);
}
void main() {
test('recorded action, risk and options survive the card model', () {
final card = chatPermissionCard(permission(), '')!;
@@ -331,7 +340,8 @@ void main() {
await tester.pumpAndSettle();
expect(find.text('Approve bash'), findsOneWidget);
expect(find.byTooltip('Stop'), findsOneWidget);
expect(find.byKey(const Key('chat-composer-stop')), findsNothing);
await expectStopInMoreMenu(tester);
gateway.emitRaw({
'type': 'chat_permission',
@@ -339,9 +349,10 @@ void main() {
});
await tester.pumpAndSettle();
// No filler line while the turn runs; Stop is the running signal.
// No filler line while the turn runs; the More menu keeps Stop reachable.
expect(find.byKey(const Key('chat-running')), findsNothing);
expect(find.byTooltip('Stop'), findsOneWidget);
expect(find.byKey(const Key('chat-composer-stop')), findsNothing);
await expectStopInMoreMenu(tester);
});
testWidgets('consecutive Material cards stay separate surfaces', (