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
+15
View File
@@ -34,6 +34,21 @@
`tool/analyze.sh` (whole app): clean, exit 0.
## Land-gate fix (visit 2)
`chat_permission_card_test.dart`: "a turn waiting on a pending card hides the
running indicator but keeps Stop" asserted a `Stop` tooltip on the composer,
which this change removes by design. It now asserts no `chat-composer-stop`
and that Stop is in the More menu, before and after the permission resolves.
Expectations for behaviour this change did not touch are unchanged.
| Run | Paths | Result |
|---|---|---|
| 3 | `chat_permission_card_test`, `chat_thread_stop_menu_test` | PASS 15/15 |
| 4 | all six focused paths above (escape, spinner, running, stop menu, bar state, permission card) | PASS 44/44 |
`tool/analyze.sh`: clean, exit 0.
## Affected states (widget tests)
- Running: no `chat-composer-stop`; Send present; border present; no interrupt sent.
@@ -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', (