Created
February 27, 2019 16:50
-
-
Save albertusdev/bd010d693338b2bfa7434eac3bbfbe63 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
testWidgets('Bottom sheet should appear and show correct icon', | |
(WidgetTester tester) async { | |
BuildContext savedContext; | |
await tester | |
.pumpWidget(MaterialApp(home: Builder(builder: (BuildContext context) { | |
savedContext = context; | |
return Container(); | |
}))); | |
await tester.pump(); | |
expect(find.byIcon(Icons.add_photo_alternate), findsNothing); | |
expect(find.byIcon(Icons.add_a_photo), findsNothing); | |
ImagePickerBottomSheet.showImagePickerBottomSheet(savedContext); | |
await tester.pump(); // Bottom sheet show animation starts | |
await tester.pump(const Duration(seconds: 2)); // animation done | |
expect(find.byIcon(Icons.add_photo_alternate), findsOneWidget); | |
expect(find.byIcon(Icons.add_a_photo), findsOneWidget); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment