-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ import '../../../helpers/test_locator.dart'; | |
|
||
class MockBuildContext extends Mock implements BuildContext {} | ||
|
||
class MockEditProfilePageViewModel extends Mock | ||
implements EditProfilePageViewModel {} | ||
|
||
class MockCallbackFunction extends Mock { | ||
void call(); | ||
} | ||
|
@@ -295,6 +298,32 @@ Future<void> main() async { | |
tester.tap(imageAvatar); | ||
}); | ||
}); | ||
testWidgets("Testing Update butoon", (tester) async { | ||
await mockNetworkImages(() async { | ||
final mockctx = MockBuildContext(); | ||
userConfig.updateUser(User()); | ||
userConfig.updateUser( | ||
User(firstName: 'Test', lastName: 'Test', email: '[email protected]'), | ||
); | ||
await tester.pumpWidget(createChangePassScreenDark()); | ||
await tester.pumpAndSettle(); | ||
final screenScaffoldWidget = find.byKey( | ||
const Key('EditProfileScreenScaffold'), | ||
); | ||
expect(screenScaffoldWidget, findsOneWidget); | ||
expect( | ||
(tester.firstWidget(find.byKey(const Key('Root'))) as MaterialApp) | ||
.theme! | ||
.scaffoldBackgroundColor, | ||
TalawaTheme.darkTheme.scaffoldBackgroundColor, | ||
); | ||
final updateButtonFinder = find.byKey(const Key('updatebtn')); | ||
expect(updateButtonFinder, findsOneWidget); | ||
await tester.tap(updateButtonFinder); | ||
await tester.pumpAndSettle(); | ||
// verify(FocusScope.of(mockctx).unfocus()).called(1); | ||
}); | ||
}); | ||
}); | ||
group('Testing image selection and removal in Edit Profile Screen', () { | ||
setUp(() { | ||
|