-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1236 Create tests for organization_feed.dart #1478
Fixes #1236 Create tests for organization_feed.dart #1478
Conversation
95bf982
to
3bea609
Compare
4f04f70
to
a163de5
Compare
@Ayush0Chaudhary do you need help in getting to 100% ? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to get it to 100%
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## develop #1478 +/- ##
===========================================
+ Coverage 78.63% 78.69% +0.05%
===========================================
Files 146 146
Lines 7219 7225 +6
===========================================
+ Hits 5677 5686 +9
+ Misses 1542 1539 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Please fix the linting error |
1f47281
to
16a14e7
Compare
@noman2002 I was not able to mock stream and and I tried other methods, but was unsuccessful. |
@noman2002 @TheHazeEffect please review! |
@Ayush0Chaudhary Please don't remove reviewers, it is assigned for a purpose. Please refrain from these type of practice. |
You can take help from @literalEval |
I 100% agree. Our volunteers have conflicting priorities and may not always be available on demand, but we are all trying to improve the code base. |
Sorry @palisadoes @noman2002 That led to removal of @TheHazeEffect review It won't happen again, it was not intentional. |
Thanks |
@@ -143,6 +143,7 @@ class CreateEventViewModel extends BaseModel { | |||
Future<void> getImageFromGallery({bool camera = false}) async { | |||
final _image = | |||
await _multiMediaPickerService.getPhotoFromGallery(camera: camera); | |||
print(_image); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove print command.
|
||
_updatePostSubscription = | ||
_postService.updatedPostStream.listen((post) => updatedPost(post)); | ||
print(_posts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove print
// tester.allElements.forEach((element) { | ||
// print(element); | ||
// }); | ||
|
||
// _organizationFeedViewModel.setValueForTest(); | ||
|
||
// final u1 = User( | ||
// id: '123', | ||
// firstName: 'John', | ||
// lastName: 'Doe', | ||
// email: '[email protected]', | ||
// ); | ||
// final u2 = User( | ||
// id: '123', | ||
// firstName: 'Ayush', | ||
// lastName: 'Chaudhary', | ||
// email: '[email protected]', | ||
// ); | ||
// final List<User> users = [u1, u2]; | ||
// | ||
// final LikedBy l1 = LikedBy(sId: 'test1'); | ||
// final LikedBy l2 = LikedBy(sId: 'test2'); | ||
// final List<LikedBy> likeby = [l1, l2]; | ||
// | ||
// final comment1 = Comments(sId: 'comment1'); | ||
// final comment2 = Comments(sId: 'comment2'); | ||
// final comment3 = Comments(sId: 'comment3'); | ||
// final List<Comments> comments = [comment1, comment2, comment3]; | ||
// | ||
// final myBirthday = DateTime.utc(2004, DateTime.june, 16, 5, 30, 0, 0, 0); | ||
// final post = Post( | ||
// creator: User( | ||
// id: '123', | ||
// firstName: 'John', | ||
// lastName: 'Doe', | ||
// email: '[email protected]', | ||
// ), | ||
// sId: "sid", | ||
// createdAt: myBirthday, | ||
// description: 'test description', | ||
// imageUrl: 'https://image.com', | ||
// videoUrl: 'https://image.com', | ||
// organization: OrgInfo(admins: users), | ||
// likedBy: likeby, | ||
// comments: comments, | ||
// ); | ||
// final List<Post> posts = [post]; | ||
// when(postservice.postStream). | ||
// final StreamController<List<Post>> _streamController = StreamController(); | ||
// final Stream<List<Post>> _stream = | ||
// _streamController.stream.asBroadcastStream(); | ||
|
||
// final service = MockPostService(); | ||
// when(service.postStream).thenAnswer((invocation) { | ||
// return _stream; | ||
// }); | ||
// postservice.postStream.listen((event) { | ||
// print(11); | ||
// }); | ||
// getAndRegisterPostService(); | ||
// _streamController.add(posts); | ||
// await tester.drag( | ||
// find.byType(RefreshIndicator), | ||
// const Offset(0, 200), | ||
// ); | ||
|
||
// await tester.pumpAndSettle(Duration(milliseconds: 100)); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these commented code.
@noman2002 @palisadoes made the suggested changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge this but let the issue be open.
What kind of change does this PR introduce?
Fixes #1236 Create tests for organization_feed.dart
Issue Number:
Fixes #1236
Did you add tests for your changes?
Summary
Fixes #1236 Create tests for organization_feed.dart
Does this PR introduce a breaking change?
NO
Have you read the contributing guide?
YES