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

Added unit test for MutationDetail #2568

Closed

Conversation

anandwana001
Copy link
Collaborator

Fixes #2567

@sufyanAbbasi PTAL?

Screenshot 2024-07-23 at 1 17 40 PM

@shobhitagarwal1612
Copy link
Member

Why do we need test coverage for a data class?

@anandwana001
Copy link
Collaborator Author

Why do we need test coverage for a data class?

Yes, writing a separate test file might not require or can be covered with another dependent file, but

  1. This file is mentioned in my task list as it's a 0% code coverage
  2. IMO, writing test cases might look extra but it's good to have as we can say we have both dependent and independent test cases written which is helping us to achieve 100% code coverage

WDYT?

@shobhitagarwal1612
Copy link
Member

shobhitagarwal1612 commented Jul 23, 2024

Adding coverage via this way doesn't achieve anything and is giving a false sense of coverage. I'd recommend not adding it. Instead, we should see which code flow should have covered these files and add tests for that.

For e.g. MutationDetail object is created when displaying the SyncStatusFragment. So, adding unit tests for this fragment should automatically cover these files as well.

@anandwana001
Copy link
Collaborator Author

Got it, let me close this pr and we will cover it with the SyncStatusFragment . Thanks

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.

[Code health] Add Unit Test for MutationDetail
2 participants