@@ -1048,68 +1048,7 @@ void main() {
10481048 );
10491049
10501050 testWidgets (
1051- 'active alarm close button shows confirm dialog and stay keeps alarm' ,
1052- (tester) async {
1053- await setLargeTestViewport (tester);
1054- now = DateTime .now ();
1055-
1056- final schedule = buildSchedule (
1057- id: 's-active-stay' ,
1058- scheduleTime: now.add (const Duration (minutes: 35 )),
1059- steps: const [
1060- PreparationStepWithTimeEntity (
1061- id: 'p1' ,
1062- preparationName: 'Prep' ,
1063- preparationTime: Duration (minutes: 10 ),
1064- nextPreparationId: null ,
1065- ),
1066- ],
1067- );
1068-
1069- final router = GoRouter (
1070- initialLocation: '/alarmScreen' ,
1071- routes: [
1072- GoRoute (path: '/home' , builder: (_, __) => const Text ('HOME' )),
1073- GoRoute (
1074- path: '/alarmScreen' ,
1075- builder: (_, __) => const AlarmScreen (),
1076- ),
1077- ],
1078- );
1079-
1080- final earlyBundle = createEarlyStartUseCaseBundle ();
1081- final alarmBloc = ScheduleBloc .test (
1082- StubGetNearestUpcomingScheduleUseCase (() => Stream .value (schedule)),
1083- navigationService,
1084- NoopSaveTimedPreparationUseCase (),
1085- StubGetTimedPreparationSnapshotUseCase ({}),
1086- NoopClearTimedPreparationUseCase (),
1087- startUseCase,
1088- finishUseCase,
1089- markEarlyStartSessionUseCase: earlyBundle.markUseCase,
1090- getEarlyStartSessionUseCase: earlyBundle.getUseCase,
1091- clearEarlyStartSessionUseCase: earlyBundle.clearUseCase,
1092- nowProvider: () => now,
1093- );
1094- addTearDown (alarmBloc.close);
1095-
1096- await pumpWithRouter (tester, bloc: alarmBloc, router: router);
1097- await tapAndPump (tester, find.byKey (const Key ('alarm_close_button' )));
1098- await pumpUntilFound (tester, find.byType (TwoActionDialog ));
1099-
1100- await tapAndPump (tester, find.text ("I'll stay" ));
1101- await tester.pump (const Duration (milliseconds: 150 ));
1102-
1103- expect (find.text ('HOME' ), findsNothing);
1104- expect (find.byType (AlarmScreen ), findsOneWidget);
1105- alarmBloc.add (const ScheduleFinished (0 ));
1106- await tester.pump ();
1107- },
1108- timeout: const Timeout (Duration (seconds: 15 )),
1109- );
1110-
1111- testWidgets (
1112- 'active alarm close button leave action navigates home' ,
1051+ 'active alarm close button navigates home without confirmation' ,
11131052 (tester) async {
11141053 await setLargeTestViewport (tester);
11151054 now = DateTime .now ();
@@ -1156,11 +1095,10 @@ void main() {
11561095
11571096 await pumpWithRouter (tester, bloc: alarmBloc, router: router);
11581097 await tapAndPump (tester, find.byKey (const Key ('alarm_close_button' )));
1159- await pumpUntilFound (tester, find.byType (TwoActionDialog ));
11601098
1161- await tapAndPump (tester, find.text ("I'm leaving" ));
11621099 await pumpUntilRouteText (tester, 'HOME' );
11631100
1101+ expect (find.byType (TwoActionDialog ), findsNothing);
11641102 expect (find.text ('HOME' ), findsOneWidget);
11651103 alarmBloc.add (const ScheduleFinished (0 ));
11661104 await tester.pump ();
0 commit comments