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

fix(RHINENG-12778): Add tooltip for locked OS versions #2197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

johnsonm325
Copy link
Contributor

This PR notifies a user if a system's OS version is locked. When version locking is enabled for a system i.e. a system's OS is tied to a release version, that can affect the count of applicable and installable errata\advisories.

The backend now passes a key from the /systems api endpoint called rhsm_lock and the value is the locked version number. With this PR, we check on the Systems table as well as the CVEs -> CVEDetails tables. When the rhsm_lock parameter has a value, we include an icon with a tooltip that tells the user "Your RHEL version is locked..." and at which version it is locked at.

@johnsonm325 johnsonm325 requested a review from a team as a code owner January 24, 2025 22:04
Copy link

jira-linking bot commented Jan 24, 2025

Referenced Jiras:
https://issues.redhat.com/browse/RHINENG-12778

@johnsonm325
Copy link
Contributor Author

If someone has a clever way to test this, I'd love to hear it. Considering we can't render the InventoryTable component in tests, I'm having a hard time knowing how to test this new fix.

This PR notifies a user if a system's OS version is locked. When version
locking is enabled for a system i.e. a system's OS is tied to a release
version, that can affect the count of applicable and installable
errata\advisories.

The backend now passes a key from the `/systems` api endpoint
called `rhsm_lock` and the value is the locked version number. With this
PR, we check on the Systems table as well as the CVEs -> CVEDetails
tables. When the `rhsm_lock` parameter has a value, we include an icon
with a tooltip that tells the user "Your RHEL version is locked..." and
at which version it is locked at.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.10%. Comparing base (a504faa) to head (40bcfbf).

Files with missing lines Patch % Lines
src/Helpers/constants.js 54.54% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2197      +/-   ##
==========================================
+ Coverage   67.14%   69.10%   +1.96%     
==========================================
  Files         130      131       +1     
  Lines        3476     3483       +7     
  Branches     1106     1106              
==========================================
+ Hits         2334     2407      +73     
+ Misses       1142     1076      -66     

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

Comment on lines +36 to +46
beforeEach(() => {
useSelector.mockImplementation(callback => {
return callback({ SystemsPageStore: initialState, entities: entitiesInitialState });
});
useDispatch.mockReturnValue(jest.fn());
});

it.skip('should call fetchData function', () => {
afterEach(() => {
useSelector.mockClear();
store.clearActions();
});
Copy link
Member

Choose a reason for hiding this comment

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

It might be better to put them within the describe to ensure the effects of these callbacks don't leak into other tests.

@bastilian
Copy link
Member

If someone has a clever way to test this

We might be able to test tooltips with the hover() function in Jest: https://testing-library.com/docs/user-event/convenience/#hover

Copy link
Member

@bastilian bastilian left a comment

Choose a reason for hiding this comment

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

Tested and (i) + Tooltip show up as expected. Thank you @johnsonm325!

@johnsonm325
Copy link
Contributor Author

If someone has a clever way to test this

We might be able to test tooltips with the hover() function in Jest: https://testing-library.com/docs/user-event/convenience/#hover

@bastilian my issues is that I can't render the InventoryTable in tests. And since the tooltip is linked to the columns, I'm not sure how to get this tooltip to render.

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.

3 participants