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

[Backend]Test asset groups creation/update (#1494) #2150

Merged
merged 8 commits into from
Jan 6, 2025

Conversation

johanah29
Copy link
Member

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.07%. Comparing base (552196f) to head (41fd4c8).
Report is 3 commits behind head on release/1.11.0.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             release/1.11.0    #2150      +/-   ##
====================================================
+ Coverage             35.98%   36.07%   +0.08%     
- Complexity             1487     1491       +4     
====================================================
  Files                   546      546              
  Lines                 16626    16630       +4     
  Branches               1061     1061              
====================================================
+ Hits                   5983     5999      +16     
+ Misses                10340    10328      -12     
  Partials                303      303              

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

@antoinemzs antoinemzs self-requested a review January 6, 2025 09:41
Copy link
Contributor

@antoinemzs antoinemzs left a comment

Choose a reason for hiding this comment

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

Good start, thanks !

Apart from a few nitpicks, perhaps also consider adding more tests cases, e.g.:

  • for when the asset group does not exist (for update)
  • for other types of properties, eg description, tags, filter (create, update).

@RomuDeuxfois
Copy link
Member

Good start, thanks !

Apart from a few nitpicks, perhaps also consider adding more tests cases, e.g.:

  • for when the asset group does not exist (for update)
  • for other types of properties, eg description, tags, filter (create, update).

Johanah being on leave, I take over on her PRs.

I took your comments into account and added the Transactional annotation.

I also took the opportunity to change the name of the methods to follow this pattern: given this should have that.
What do you think of this pattern?

@antoinemzs
Copy link
Contributor

What do you think of this pattern?

Great pattern IMO for self explanatory test scopes. "Given this then that" or "when/with this it does that" are two widely used speech-like patterns that are also useful for the developer to limit the scope of their own tests.

Copy link
Contributor

@antoinemzs antoinemzs left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@Dimfacion Dimfacion left a comment

Choose a reason for hiding this comment

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

LGTM too :) Just a small nitpick but I think we should return a 404 if deleting a non existent element. It seems more logical to me as it can hide an issue in the frontend :
Imagine you have a bad code on your frontend or a client of the API, you have the id incorrectly set. You'll get back a 200 but the element won't be correctly deleted. Debugging this might prove annoying.

@RomuDeuxfois RomuDeuxfois merged commit a2c60d2 into release/1.11.0 Jan 6, 2025
4 checks passed
@RomuDeuxfois RomuDeuxfois deleted the issue/1494 branch January 6, 2025 16:33
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.

[ Unit testing - assets scope ] - Asset groups creation/update
4 participants