-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
-
None
-
Quality / Stability / Reliability
-
False
-
-
False
-
None
-
None
-
None
-
None
-
None
This is a follow-on story from the Enzyme to RTL test effort.
Refactor operator-lifecycle-manager component tests to follow React Testing Library best practices by testing user behavior instead of implementation details. Currently, multiple test files verify internal component structure (mock calls, prop structures, internal APIs) rather than what users actually see and interact with.
Tests (# needing refactoring)
- frontend/packages/operator-lifecycle-manager/src/components/catalog-source.spec.tsx (6 tests)
- frontend/packages/operator-lifecycle-manager/src/components/subscription.spec.tsx (12 tests)
- frontend/packages/operator-lifecycle-manager/src/components/install-plan.spec.tsx (20 tests)
- frontend/packages/operator-lifecycle-manager/src/components/package-manifest.spec.tsx (8 tests)
Component files for reference
catalog-source.tsx
subscription.tsx
install-plan.tsx
package-manifest.tsx
Acceptance Criteria
Tests should:
- Use `screen` queries (`getByRole`, `getByText`, `getByLabelText`)
- Test what users see (`toBeVisible()`, not `toBeInTheDocument()`)
- Test interactions (clicking tabs, buttons, entering text)
- Verify user workflows (navigation, form submission, data display)
- Not access `.mock.calls` or check internal props
- Not use enzyme's `shallow` or `find` APIs
- Use `renderWithProviders` with full component rendering