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

Add unit tests for Namespace filtering in resources #7465

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

cnotv
Copy link
Member

@cnotv cnotv commented Nov 16, 2022

Summary

Fixes #7391
These tests are aimed to ensure the functionalities of the namespace filter an part of the Workload fetching data capabilities.

Occurred changes and/or fixed issues

  • Prevented issues in NamespaceFilter component in case of missing props or data, e.g. currentProduct
  • Added data-testid attributes for selecting component.

Technical notes summary

  • Added jest.restoreAllMocks() globally for jest setup
  • Added information related on global configuration for the unit tests in the documentation

Areas or cases that should be tested

Areas which could experience regressions

Screenshot/Video

…ata-testid attributes for testing purposes and ocmments for readability
@cnotv cnotv added this to the v2.7.1 milestone Nov 16, 2022
@cnotv cnotv requested a review from catherineluse November 16, 2022 15:34
@cnotv cnotv force-pushed the feature/7391-namespace-filtering-tests branch from 07d9545 to 8e276c3 Compare November 16, 2022 18:42
@cnotv cnotv requested review from rak-phillip and catherineluse and removed request for catherineluse November 16, 2022 18:42
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

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

I think the tests look great. I just have a few comments on spy usage, todos, and tsc warnings 🙂

@cnotv cnotv force-pushed the feature/7391-namespace-filtering-tests branch from 20657f7 to 547c846 Compare November 17, 2022 19:50
@cnotv cnotv requested a review from rak-phillip November 17, 2022 19:51
Copy link
Member

@rak-phillip rak-phillip left a comment

Choose a reason for hiding this comment

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

LGTM

@cnotv cnotv merged commit cd947db into rancher:master Nov 17, 2022
@catherineluse
Copy link
Contributor

catherineluse commented Nov 18, 2022

It looks like cluster explorer is no longer rendering for downstream clusters. The error says something about the namespace filter. could it have been caused by a change in this PR?

Screenshot 2022-11-17 at 5 32 28 PM

@cnotv
Copy link
Member Author

cnotv commented Nov 18, 2022

@catherineluse I have created a new issue here: #7495
Could you please define how to reproduce it?

@cnotv
Copy link
Member Author

cnotv commented Nov 18, 2022

@catherineluse Taking a look to the code, I see nothing which may cause issues, rather the other way around, to prevent access function when undefined. In the same way I don't see any other commit either since a while.

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.

Add unit tests for Namespace filtering in resources
3 participants