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

feat(screenshots): add the stringIds parameter support #271

Merged
merged 4 commits into from
Oct 16, 2024
Merged

feat(screenshots): add the stringIds parameter support #271

merged 4 commits into from
Oct 16, 2024

Conversation

EvilKot
Copy link
Contributor

@EvilKot EvilKot commented Oct 15, 2024

Closes #256

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.38%. Comparing base (f45d418) to head (02a681e).
Report is 111 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #271       +/-   ##
===========================================
+ Coverage   50.38%   63.38%   +13.00%     
===========================================
  Files         277      399      +122     
  Lines        3688     6084     +2396     
  Branches        0      501      +501     
===========================================
+ Hits         1858     3856     +1998     
- Misses       1830     2189      +359     
- Partials        0       39       +39     

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

@EvilKot
Copy link
Contributor Author

EvilKot commented Oct 15, 2024

Hello, creating a PR in relation to #256 (comment)

I haven't found any tests related to InternalExtensions, except one checking orderBy string generation.
Also there's no tests checking Screenshots.ListScreenshots method (only this ones) so i have no reference/example how to add a new ones.

If it's a mandatory, I'd be really grateful for any help and tips how i could add them.
Thank you!

@andrii-bodnar
Copy link
Member

Hello @EvilKot, thanks a lot for the contribution!

It would be nice to add tests for the InternalExtensions class and Screenshots.ListScreenshots method. For reference, I think you can use the ProjectsApiTests:ListProjects test case.

The testing approach requires some boilerplate code like resources (e.g. Projects.resx, Projects.Designer.cs). I'm not quite sure how this code is generated.

@EvilKot
Copy link
Contributor Author

EvilKot commented Oct 15, 2024

Thank you, @andrii-bodnar!

For Screenshots.ListScreenshots i've added a test based on example you provided. I however manually adjusted corresponsing .resx and .Designer.cs files.

For InternalExtensions i'm not sure i'm going in a right way and if it's actually worth to cover it with tests:

  • Most of the class methods are already being tested indirectly.
  • I placed my InternalExtensionsTest.cs file in tests/Crowdin.Api.Tests/Core directory, mirroring the placement of InternalExtensions.cs located in src/Crowdin.Api/Core, similar to how it's done for other tests. However Core directory inside Crowdin.Api.Tests project serves a bit different purpose and now only contains shared test utilities and .resx files. If the long term goal is to also cover everything in src/Crowdin.Api/Core with tests, then i'd suggest moving util and .resx files to another directory, hmmm, maybe something like tests/Crowdin.Api.Tests/TestUtils?
  • Covered only query string generation methods.

One more thing - i'm a bit struggling with indentation settings used in this repo.
Originally my IDE removed whitespaces from blank lines and i not sure how to recover it and if it makes any difference.

🥹

@andrii-bodnar
Copy link
Member

@EvilKot thank you!

i'd suggest moving util and .resx files to another directory, hmmm, maybe something like tests/Crowdin.Api.Tests/TestUtils

It definitely makes a lot of sense to move those resources and utilities to TestUtils.

One more thing - i'm a bit struggling with indentation settings used in this repo.
Originally my IDE removed whitespaces from blank lines and i not sure how to recover it and if it makes any difference.

I think it would be better to undo this change and avoid trailing spaces.

@EvilKot
Copy link
Contributor Author

EvilKot commented Oct 16, 2024

@andrii-bodnar, i'm afraid this PR will become super inflated if i move things into /TestUtils, since it will impact almost every file in tests project 😅

indentation updated 👍

@andrii-bodnar
Copy link
Member

@EvilKot sure, it's definitely out of the scope of the current PR

@andrii-bodnar
Copy link
Member

@EvilKot I just created a separate issue for that - #272

Copy link
Member

@andrii-bodnar andrii-bodnar left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @EvilKot!

@andrii-bodnar andrii-bodnar merged commit 98f92b8 into crowdin:main Oct 16, 2024
6 checks passed
@EvilKot
Copy link
Contributor Author

EvilKot commented Oct 16, 2024

Yay, thank you for walking me through!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screenshots APIs: add the stringIds parameter support
2 participants