ROX-33571: Add component tests for container display components#19513
ROX-33571: Add component tests for container display components#19513dvail wants to merge 3 commits intodv/ROX-33571-consolidate-container-displayfrom
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The container fixtures in both test files are quite verbose and largely duplicated; consider extracting a shared factory/helper for creating
Containerobjects so individual tests can focus on the specific fields they care about. - In
SecurityContextCardtests, assertions likegetByText('true')are a bit brittle and could match unintended content; using more specific queries (e.g., scoped within a row/section or asserting on labels/roles) would make these tests more robust to UI changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The container fixtures in both test files are quite verbose and largely duplicated; consider extracting a shared factory/helper for creating `Container` objects so individual tests can focus on the specific fields they care about.
- In `SecurityContextCard` tests, assertions like `getByText('true')` are a bit brittle and could match unintended content; using more specific queries (e.g., scoped within a row/section or asserting on labels/roles) would make these tests more robust to UI changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…g, fix readOnly display
|
Images are ready for the commit at 0c9b676. To use with deploy scripts, first |
Create DeploymentContainersCard wrapper for container display Migrate Violations container config to shared component Create SecurityContextCard for filtered security context display Migrate Violations security context to shared component Migrate Risk container config to shared PF6 component Migrate Risk security context to shared PF6 component Fix ESLint: use ?? instead of ||
4fdb017 to
df2f821
Compare
0c9b676 to
7d53616
Compare
Remove low-value tests, keep filtering logic test Simplify test mocks with type casting Fix type assertions with unknown cast
7d53616 to
5fb2902
Compare
df2f821 to
5095833
Compare
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dv/ROX-33571-consolidate-container-display #19513 +/- ##
==============================================================================
- Coverage 49.27% 49.26% -0.01%
==============================================================================
Files 2726 2726
Lines 205625 205625
==============================================================================
- Hits 101312 101299 -13
- Misses 96777 96786 +9
- Partials 7536 7540 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Adds comprehensive Vitest component tests for the new shared container display components:
DeploymentContainersCard.test.tsx (90 lines):
SecurityContextCard.test.tsx (150 lines):
All tests use Vitest with React Testing Library and validate both rendering and props handling.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
npm run testPart of ROX-33571 container display consolidation stack.
Depends on: #19512