Created
March 20, 2019 15:40
-
-
Save albertusdev/a705cdc0b74f8c5bcfde07ac2af7716d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> chooseImageFromImagePicker(WidgetTester tester, {bool shouldConfirm = true}) async { | |
channel.setMockMethodCallHandler((MethodCall methodCall) async { | |
log.add(methodCall); | |
return './assets/images/pattern-bg.png'; | |
}); | |
await tester.tap(find.byKey(const Key('addPhotoLabel'))); | |
await tester.pump(); | |
await tester.pumpAndSettle(); | |
expect( | |
find.byKey(const Key('chooseImageFromCameraListTile')), findsOneWidget); | |
await tester.tap(find.byKey(const Key('chooseImageFromCameraListTile'))); | |
await tester.pump(); | |
await tester.tap(find.byKey(shouldConfirm ? confirmImageButtonKey : rejectImageButtonKey)); | |
await tester.pumpAndSettle(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment