-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improve renderSolution function if solution is empty #1909
Conversation
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.
The solution is good.
Let's add a test and go for it
15b0440
to
aac5c6f
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.
Looking good.
I would create a more complete test to check all the "empty" value visualizations.
And update the test name accordingly
3bf9c1e
to
44f15af
Compare
@@ -110,4 +110,54 @@ describe('SaptuneDetails', () => { | |||
staging.solutions_ids | |||
); | |||
}); | |||
|
|||
it.each([ | |||
{ solution: null }, |
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.
why all of this strange things?
Except the null
option the other 2 are not real cases. They won't happen, so we don't need to test them.
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.
Fair enough, the other cases are irrelevant, i just thought some extra error testing won't harm :D
enabledSolution={solution} | ||
hostname={hostname} | ||
hostID={hostID} | ||
configuredVersion={configuredVersion} |
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.
Send enabledNotes
and appliedNotes
as empty lists and check we display them as "empty"
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.
Yeah sure :D
7d8c54a
to
560c5b9
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.
Noice!
Description
A quick fix to ensure that SaptuneDetails is rendered properly if solutions are empty
If solution is empty then applied and enabled solution will render '-'
Demo
How was this tested?
Added automated test