talawa
talawa copied to clipboard
Views: Create tests for organization_feed.dart
- Please coordinate issue assignment and PR reviews with the contributors listed in this issue https://github.com/PalisadoesFoundation/talawa/issues/359
The Talawa code base needs to be 100% reliable. This means we need to have 100% test code coverage.
Tests need to be written for file lib/views/after_auth_screens/feed/organization_feed.dart
- When complete, all methods, classes and/or functions in the file will need to be tested.
- These tests must be placed in a single file with the name
test/views/after_auth_screens/feed/organization_feed_test.dart
. You may need to create the appropriate directory structure to do this.
IMPORTANT:
Please refer to the parent issue on how to implement these tests correctly:
- https://github.com/PalisadoesFoundation/talawa/issues/1217
PR Acceptance Criteria
- When complete this file must show 100% coverage when merged into the code base. This will be clearly visible when you submit your PR.
- The current code coverage for the file can be found here. If the file isn't found in this directory, or there is a 404 error, then tests have not been created.
- The PR will show a report for the code coverage for the file you have added. You can use that as a guide.
- You can verify your own code coverage by creating an account at Codecov.io
- No functionality must be removed to achieve this goal
i wolud like to solve this issue please assign to me
Unassigned due to inactivity.
@noman2002 @palisadoes @TheHazeEffect please assign this issue to me!
I am facing a issue solving this issue. https://github.com/PalisadoesFoundation/talawa/blob/311b205a8371eee891e5bef1a794f904295cd6cb/lib/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart#L51-L67
the above code uses a stream and set value of _post variable
But all the test written return null, I was not able to find a test where actual post list was returned
@noman2002 @palisadoes can you help me with this
I have achieved 90% coverage but small part require the actual post to test https://github.com/PalisadoesFoundation/talawa/blob/311b205a8371eee891e5bef1a794f904295cd6cb/lib/views/after_auth_screens/feed/organization_feed.dart#L60-L64
https://github.com/PalisadoesFoundation/talawa/blob/311b205a8371eee891e5bef1a794f904295cd6cb/test/widget_tests/after_auth_screens/events/explore_events_test.dart#L158-L178
one posiible solution is this but it return a null value
@noman2002 @TheHazeEffect Do you have any thoughts on how to resolve this?
@palisadoes @noman2002 @TheHazeEffect I implemented this and 11 is getting printed but same thing is not happening in its viewmodel Their is a problem with the scope of Mock Can you help me with this??
@literalEval can you suggest something??
@Ayush0Chaudhary I believe your reference of the view model is different then the one that the widget is using, I mean both are different instances.
I was having the same issue while writing tests for a widget and I worked it around by referencing the view model used by the widget directly. Something like
late VM _vm;
....
....
BaseView<VM> (
onModelReady: (model) {
_vm = model;
}
)
This way you can be sure that you are referencing the exact same view model.
@literalEval You can try on this issue.
Sure. I will take this issue once I am done with the issues I am already assigned with.
This is reopened because test coverage for this file is not acceptable.
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.
Can you please assign this issue to me.
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.
Unassigning due to inactivity.
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.