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

Refactor empty state handling across tables; implement tests #302

Merged

Conversation

gkarat
Copy link
Collaborator

@gkarat gkarat commented Jun 2, 2022

Implements https://issues.redhat.com/browse/CCXDEV-8280, https://issues.redhat.com/browse/CCXDEV-8242

Mainly refactors how table components are handling empty states. Also adds tests to check that the empty state titles, messages, and icons are rendered correctly.

Some illustrations:

Screenshot 2022-06-03 at 15-53-02 37556893-a47d-4b14-8e8b-e0f741f7df4f - Clusters - OCP Advisor Red Hat Insights
Screenshot 2022-06-03 at 15-52-30 No Issues Cluster - Clusters - OCP Advisor Red Hat Insights
Screenshot 2022-06-03 at 15-52-17 Test disable recommendation - Clusters - OCP Advisor Red Hat Insights
Screenshot 2022-06-03 at 15-51-59 Recommendations - OCP Advisor Red Hat Insights
Screenshot 2022-06-03 at 15-51-45 Data loss will happen when a machine object is deleted that maps to a 'NotReady' node with attached VMDK volumes - Recommendations - OCP Advisor Red Hat Insights

@gkarat gkarat added the tests label Jun 2, 2022
@gkarat gkarat self-assigned this Jun 2, 2022
@gkarat gkarat marked this pull request as ready for review June 3, 2022 12:41
@gkarat gkarat marked this pull request as draft June 3, 2022 12:42
@gkarat gkarat marked this pull request as ready for review June 3, 2022 13:54
@gkarat gkarat requested review from Fewwy and ikerreyes and removed request for Fewwy June 3, 2022 13:54
@gkarat gkarat requested a review from Fewwy June 3, 2022 13:54
@gkarat gkarat changed the title Test empty state with no matching items across tables Refactor empty state handling across tables; implement tests Jun 3, 2022
@gkarat
Copy link
Collaborator Author

gkarat commented Jun 3, 2022

@RedHatInsights/team-interact, @ikerreyes, please take a look 👋🏼

Copy link
Collaborator

@ikerreyes ikerreyes left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the work.

Just left some minor comments.

cypress/utils/table.js Outdated Show resolved Hide resolved
src/Components/Cluster/Cluster.spec.ct.js Outdated Show resolved Hide resolved
src/Components/Cluster/Cluster.spec.ct.js Outdated Show resolved Hide resolved
src/Components/Cluster/Cluster.spec.ct.js Outdated Show resolved Hide resolved
src/Components/RecsListTable/RecsListTable.spec.ct.js Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #302 (92881de) into master (f081996) will decrease coverage by 0.49%.
The diff coverage is 87.87%.

❗ Current head 92881de differs from pull request most recent head e665fa8. Consider uploading reports for the commit e665fa8 to get more accurate results

@@            Coverage Diff             @@
##           master     #302      +/-   ##
==========================================
- Coverage   85.65%   85.16%   -0.50%     
==========================================
  Files          24       24              
  Lines         962      984      +22     
  Branches      351      359       +8     
==========================================
+ Hits          824      838      +14     
- Misses        138      146       +8     
Impacted Files Coverage Δ
src/Components/Cluster/Cluster.js 100.00% <ø> (ø)
src/Components/MessageState/EmptyStates.js 85.18% <77.77%> (-3.71%) ⬇️
src/Components/ClusterRules/ClusterRules.js 84.43% <86.66%> (-0.42%) ⬇️
...nts/AffectedClustersTable/AffectedClustersTable.js 88.97% <88.23%> (-1.11%) ⬇️
src/Components/RecsListTable/RecsListTable.js 79.79% <90.00%> (-0.31%) ⬇️
.../Components/ClustersListTable/ClustersListTable.js 83.20% <90.90%> (-0.52%) ⬇️
src/Components/Loading/Loading.js 100.00% <100.00%> (ø)
src/Components/MessageState/MessageState.js 100.00% <100.00%> (ø)
src/Components/ClusterHeader/index.js 100.00% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f081996...e665fa8. Read the comment docs.

@gkarat gkarat force-pushed the ccxdev-8242-enhance-empty-state-test branch from e665fa8 to 5c983e4 Compare June 3, 2022 14:41
@gkarat gkarat added the enhancement New feature or request label Jun 6, 2022
@gkarat gkarat merged commit c59821a into RedHatInsights:master Jun 7, 2022
gkarat pushed a commit that referenced this pull request Jun 7, 2022
## [1.4.4](v1.4.3...v1.4.4) (2022-06-07)

### Bug Fixes

* **Tables:** unify empty state handling across tables; implement tests ([#302](#302)) ([c59821a](c59821a))
@gkarat
Copy link
Collaborator Author

gkarat commented Jun 7, 2022

🎉 This PR is included in version 1.4.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@gkarat gkarat added the released label Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants