Skip to content

Commit bfe3ccc

Browse files
committed
integration_test: fix failures
1 parent ef06dfb commit bfe3ccc

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919

2020
- run: flutter --version
2121
- run: flutter pub get
22-
- run: dart format --output=none --set-exit-if-changed .
22+
- run: dart format --version
23+
- run: dart format --set-exit-if-changed .
2324
- run: dart analyze --fatal-infos
2425
- run: flutter test
2526

integration_test/app_test.dart

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -458,14 +458,19 @@ void main() async {
458458
await tester.pumpAndSettle();
459459

460460
expect(find.byType(Badge), findsNothing);
461-
expect(find.byType(Divider), findsNWidgets(2));
462-
expect(find.byKey(const Key('current-day')), findsOneWidget);
463461
expect(find.byKey(const Key('target-day')), findsOneWidget);
464462
expect(
465463
(tester.firstWidget(find.byKey(const Key('target-day'))) as Divider)
466464
.color,
467465
Colors.green);
468466

467+
await tester.scrollUntilVisible(find.byKey(const Key('current-day')), 50.0);
468+
await tester.pumpAndSettle();
469+
470+
expect(find.byKey(const Key('current-day')), findsOneWidget);
471+
472+
await tester.scrollUntilVisible(find.byKey(const Key('day-81')), -50.0);
473+
await tester.pumpAndSettle();
469474
await tester.tap(find
470475
.descendant(
471476
of: find.byKey(const Key('day-82')),
@@ -626,11 +631,8 @@ void main() async {
626631

627632
await tester.tap(find.byType(PlanCard).first);
628633
await tester.pumpAndSettle();
629-
await tester.scrollUntilVisible(
630-
find.byKey(const Key('day-365')),
631-
500.0,
632-
maxScrolls: 200,
633-
);
634+
await tester.scrollUntilVisible(find.byKey(const Key('day-365')), 500.0,
635+
maxScrolls: 300);
634636
await tester.pumpAndSettle();
635637
await Future<void>.delayed(Duration(seconds: 2));
636638
await tester.tap(find
@@ -882,12 +884,18 @@ void main() async {
882884

883885
await tester.tap(find.byIcon(Icons.edit));
884886
await tester.pumpAndSettle();
887+
await tester.scrollUntilVisible(find.byKey(const Key('show-events')), 50.0,
888+
scrollable: find.byType(Scrollable).last);
889+
await tester.pumpAndSettle();
885890
await tester.tap(find.byKey(const Key('show-events')));
886891
await tester.pumpAndSettle();
887892

888893
var plan = providerContainer.read(plansProvider).plans.first;
889894
expect(plan.showEvents, true);
890895

896+
await tester.scrollUntilVisible(find.byIcon(Icons.done), -50.0,
897+
scrollable: find.byType(Scrollable).last);
898+
await tester.pumpAndSettle();
891899
await tester.tap(find.byIcon(Icons.done));
892900
await tester.pumpAndSettle();
893901

@@ -917,12 +925,18 @@ void main() async {
917925

918926
await tester.tap(find.byIcon(Icons.edit));
919927
await tester.pumpAndSettle();
928+
await tester.scrollUntilVisible(find.byKey(const Key('show-events')), 50.0,
929+
scrollable: find.byType(Scrollable).last);
930+
await tester.pumpAndSettle();
920931
await tester.tap(find.byKey(const Key('show-locations')));
921932
await tester.pumpAndSettle();
922933

923934
var plan = providerContainer.read(plansProvider).plans.first;
924935
expect(plan.showLocations, true);
925936

937+
await tester.scrollUntilVisible(find.byIcon(Icons.done), -50.0,
938+
scrollable: find.byType(Scrollable).last);
939+
await tester.pumpAndSettle();
926940
await tester.tap(find.byIcon(Icons.done));
927941
await tester.pumpAndSettle();
928942

@@ -996,6 +1010,9 @@ void main() async {
9961010
matching: find.byType(Text))
9971011
.first);
9981012
await tester.pumpAndSettle();
1013+
await tester.scrollUntilVisible(find.byIcon(Icons.delete).first, 50.0,
1014+
scrollable: find.byType(Scrollable).last);
1015+
await tester.pumpAndSettle();
9991016
await tester.tap(find.byIcon(Icons.delete));
10001017
await tester.pumpAndSettle();
10011018

0 commit comments

Comments
 (0)