feat(app): Rename and Schedule this run move into the run detail's more menu
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user