Skip to content

Commit

Permalink
testing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush0Chaudhary committed Feb 9, 2023
1 parent 589c200 commit 4f04f70
Showing 1 changed file with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,43 +60,6 @@ void main() {
});
});

testWidgets(
'checks if the upload photo from gallery button ad other process are working properly',
(tester) async {
await tester.pumpWidget(createEventScreen(
theme: TalawaTheme.lightTheme,
));
await tester.pump();

/// using the key of icon button
/// because their are many icon button
final finder = find.byKey(const Key('txt_btn_cep'));

expect(finder, findsOneWidget);

///returning the file variable to the
///result of function multimediaPickerService.getPhotoFromGallery
///when this function is called in the
///view model of add_post_page.
final file = File('fakePath');

/// using the new instance of multimediaPickerService
/// so that when statement can be used again,
/// else it gives null point exception
final multimediaPickerService = locator<MultiMediaPickerService>();

/// when is function provided by mockito lib
when(multimediaPickerService.getPhotoFromGallery(camera: false))
.thenAnswer((_) async {
return file;
});

/// taping the button
await tester.tap(finder);
await tester.pump();
});

testWidgets("Testing if dark mode is applied", (tester) async {
await tester.pumpWidget(createEventScreen(
themeMode: ThemeMode.dark,
Expand Down

0 comments on commit 4f04f70

Please sign in to comment.