-
Story
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
Create comprehensive tests for RBAC permissions and feature flag toggling to ensure proper access control and graceful degradation.
Test Coverage:
RBAC Permission Tests:
1. User without BaseImage read access:
- Mock user permissions without BaseImage resource access
- Verify "Base images" dropdown option is hidden
- Verify Details tab is hidden on Image page
- Verify Layer type filter is not shown in compound search
- Verify Layer type column is not rendered in component table
- Verify app functions normally for other features
2. User with read-only BaseImage access:
- Mock user with BaseImage READ permission only
- Verify can view Details tab
- Verify cannot access BaseImagesModal (no write permission)
- Verify can use layer type filter
- Verify can see layer type column
Feature Flag Tests:
3. Feature flag OFF (ROX_BASE_IMAGE_MANAGEMENT=false):
- Verify original "Manage watched images" button shown (not dropdown)
- Verify Details tab is not rendered on Image page
- Verify layer type filter is not available
- Verify layer type column is not shown
- Verify all other features work normally
4. Feature flag ON (ROX_BASE_IMAGE_MANAGEMENT=true):
- Verify "Manage images" dropdown with both options
- Verify Details tab is visible
- Verify layer type filter is available
- Verify layer type column is shown
Acceptance Criteria:
- RBAC correctly gates all features based on permissions
- Feature flag properly toggles all UI elements
- Graceful degradation when feature is disabled
- No console errors when features are hidden
- Tests use proper mocking techniques