-
Notifications
You must be signed in to change notification settings - Fork 156
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
unit tests for SidebarQuota.vue #5229
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
ebed240
to
1824503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍🏼
1824503
to
99d9493
Compare
@@ -22,7 +22,7 @@ export default { | |||
...mapGetters(['quota']), | |||
|
|||
usedQuota() { | |||
return getResourceSize(this.quota.used) | |||
return getResourceSize(this.quota.used) || '0 B' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just change getResourceSize
so that it treats a negative number as 0?
like this:
size = (size < 0) ? 0 : size
instead of the return ''
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you are right. My thought was that the same function is also defined in
getResourceSize(size) { |
so in the next step I wanted to consolidate both functions (not sure where it has to be placed to be used from both though)
Now looking at
InfoSelectedResources.vue
in detail I think returning 0
instead of ''
would not harm there ether
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We introduced packages/web-pkg
a while ago for shared code, I think it would be good to have it there.
99d9493
to
a5d9b2d
Compare
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
0 B of 2 GB
as quota in case of a negative number given as used quota and not onlyof 2 GB
Related Issue
part of #5217
Motivation and Context
increase unit test coverage
Types of changes
Checklist:
Open tasks: