feat(app): Rename and Schedule this run move into the run detail's more menu

This commit is contained in:
2026-10-23 16:10:20 +01:00
parent 9e2d3c558d
commit 13d293eb47
12 changed files with 264 additions and 170 deletions
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/core/transport/connection_state.dart';
import 'package:pipelines_app/features/runs/ui/run_detail_actions.dart';
import 'package:pipelines_app/features/runs/ui/run_more_menu.dart';
import 'package:pipelines_app/features/schedules/ui/editor/schedule_editor_wording.dart';
import 'package:pipelines_app/features/schedules/ui/run/schedule_run_action.dart';
@@ -194,36 +194,36 @@ void main() {
tester,
) async {
final gateway = SaveGateway();
await pumpAction(
tester,
RunDetailActions(
run: runFixture(),
gateway: gateway,
onRunChanged: (_) {},
),
);
expect(find.byKey(scheduleRunActionKey), findsOneWidget);
// The run detail offers it from its more menu, beside Rename.
Future<void> openMenu(JsonMap run) async {
await pumpAction(
tester,
RunMoreMenu(
run: run,
gateway: gateway,
onRunChanged: (_) {},
cupertino: false,
),
);
// A run with nothing to offer shows no menu at all.
if (find.byKey(runMoreMenuKey).evaluate().isEmpty) return;
await tester.tap(find.byKey(runMoreMenuKey));
await tester.pumpAndSettle();
}
await openMenu(runFixture());
expect(find.text(scheduleRunActionLabel), findsOneWidget);
await tester.tap(find.text(scheduleRunActionLabel));
await tester.pumpAndSettle();
expect(find.byKey(scheduleEditorSubmitKey), findsOneWidget);
expect(gateway.calls, isEmpty);
await tester.pumpWidget(const SizedBox.shrink());
await pumpAction(
tester,
RunDetailActions(
run: runFixture(version: 0),
gateway: gateway,
onRunChanged: (_) {},
),
);
expect(find.byKey(scheduleRunActionKey), findsNothing);
await openMenu(runFixture(version: 0));
expect(find.text(scheduleRunActionLabel), findsNothing);
await pumpAction(
tester,
RunDetailActions(
run: runFixture(pipelineId: null),
gateway: gateway,
onRunChanged: (_) {},
),
);
expect(find.byKey(scheduleRunActionKey), findsNothing);
await openMenu(runFixture(pipelineId: null));
expect(find.text(scheduleRunActionLabel), findsNothing);
});
testWidgets('Cupertino uses the native action and fields', (tester) async {