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 pinned_post.dart #2178

Closed
wants to merge 6 commits into from

Conversation

nidhin29
Copy link
Contributor

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

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 Nov 29, 2023

Codecov Report

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

Comparison is base (b548497) 76.43% compared to head (ba5691d) 79.90%.
Report is 50 commits behind head on develop.

❗ Current head ba5691d differs from pull request most recent head 367fdb5. Consider uploading reports for the commit 367fdb5 to get more accurate results

Files Patch % Lines
lib/widgets/pinned_post.dart 93.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2178      +/-   ##
===========================================
+ Coverage    76.43%   79.90%   +3.47%     
===========================================
  Files          152      152              
  Lines         7438     7460      +22     
===========================================
+ Hits          5685     5961     +276     
+ Misses        1753     1499     -254     

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

@nidhin29
Copy link
Contributor Author

@noman2002 The pinned post are manually passed so is it possible to check the error cases

@nidhin29
Copy link
Contributor Author

@noman2002 Sir,I have written tests for other lines if it is possible to test the error case pls tell me and I will work on it

Comment on lines 121 to 127
: pinnedPosts[index]['imageUrl']!,
errorWidget: (context, url, error) {
return const CircularProgressIndicator();
},
height: SizeConfig.screenHeight! * 0.15,
fit: BoxFit.cover,
),
Copy link
Member

Choose a reason for hiding this comment

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

Please write the test for this error widget.

@noman2002
Copy link
Member

tests for other lines if it

Yes, Please write the test for error widget. You can mock the situation by giving incorrect image url.

@nidhin29 nidhin29 closed this Dec 3, 2023
@nidhin29 nidhin29 deleted the develop3 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
2 participants