Skip to content
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

Unittest for pinnedpost #2204

Closed
wants to merge 11 commits into from
Closed

Conversation

nidhin29
Copy link
Contributor

@nidhin29 nidhin29 commented Dec 3, 2023

This change included the Unittest for pinned post

Issue Number: #2161

Fixed #2161

Did you add tests for your changes?

Yes

Summary

It is unittest for pinned_post.

Does this PR introduce a breaking change?

No, this does not introduce any major changes to the codebase.

Have you read the contributing guide?

Yes, i have followed the guidelines.

Copy link

github-actions bot commented Dec 3, 2023

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if either of these two conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold

The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.

Reviewers

When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

Other

🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.

Copy link

codecov bot commented Dec 3, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (b548497) 76.43% compared to head (034e168) 80.20%.
Report is 54 commits behind head on develop.

Files Patch % Lines
lib/router.dart 0.00% 1 Missing ⚠️
...ws/after_auth_screens/feed/pinned_post_screen.dart 80.00% 1 Missing ⚠️
lib/widgets/pinned_post.dart 95.83% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2204      +/-   ##
===========================================
+ Coverage    76.43%   80.20%   +3.77%     
===========================================
  Files          152      149       -3     
  Lines         7438     6971     -467     
===========================================
- Hits          5685     5591      -94     
+ Misses        1753     1380     -373     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 3, 2023

@noman2002 Sir i have made this widget to use pinnedPost instead of manually passed pinnedPosts. But then other files are having a bit problem its not possible to test error cases with that manually passed data. In this pinned_post is having 100% coverage but other files. Sir, what should I do

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 3, 2023

@noman2002 I have checked that progress indicator dont know why that is not covered

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 3, 2023

@noman2002 if anything I need to correct please tell me I will try my best

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 4, 2023

@noman2002 Sir from my observation I think that pinnedPost in constructor should be used.I can test other two files if you give me permission as they are two separate issues mentioned in issue section

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 5, 2023

@noman2002 @Ayush0Chaudhary is this fine

Copy link
Contributor

@Ayush0Chaudhary Ayush0Chaudhary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the app files?
Give reasons or undo your changes/

@@ -226,8 +226,7 @@ Route<dynamic> generateRoute(RouteSettings settings) {
);
case Routes.pinnedPostScreen:
// final Map<String, dynamic> post = settings.arguments! as Map<String, dynamic> ;
final Map<String, String> post =
settings.arguments! as Map<String, String>;
final Post post = settings.arguments! as Post;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir, In the pinnedpost widget if you see the constructor you can see a variable pinnedPost which is a list of post but it was used nowhere instead a manually made list of map string was used so I made that widget to use pinnedPost. But the pinnedpostscreen widget was requiring a map string so I made a change there a made it to use post

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ayush0Chaudhary Please have a look.

@noman2002 noman2002 requested a review from literalEval December 5, 2023 15:37
@noman2002
Copy link
Member

@nidhin29 Please fix the conflicting files.

@noman2002
Copy link
Member

@noman2002 Sir those are two issues mentioned in issue. If I modify will that cause any problem

@nidhin29 Resolve the merge conflicts, it cannot be merged without resolving merge conflicts.

@nidhin29
Copy link
Contributor Author

nidhin29 commented Dec 5, 2023

@noman2002 Ok sir

@noman2002
Copy link
Member

@noman2002 Ok sir

kvbj

@nidhin29 nidhin29 closed this Dec 6, 2023
@nidhin29 nidhin29 deleted the develop7 branch December 13, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write tests for lib/widgets/pinned_post.dart
3 participants