test(frontend): Complete cleanup UI component test coverage - #9
Merged
Conversation
Add comprehensive unit tests for cleanup UI components: 1. CleanupDashboard.test.tsx (606 lines, 37 tests) - Component rendering and tab navigation - Scan configuration and operations - Cleanup operations with break-glass mode - Results display and analytics integration - All 37 tests passing 2. ScanResults.test.tsx (308 lines, 16 tests) - Orphaned uploads display - Corrupt objects with severity badges - Orphaned versions with latest/old indicators - Empty objects listing - Date and size formatting - All 16 tests passing 3. vitest.d.ts (37 lines) - Type declarations for jest-dom matchers - Enables TypeScript support for testing-library assertions Test improvements: - Fixed accessibility issues by using getByRole instead of getByLabelText - Proper mock data with all required type fields - Comprehensive coverage of user interactions and edge cases Total: 53 tests passing, 0 failures
- Add JobMonitor.test.tsx with 14 tests covering: - Job history rendering and empty states - Active job display and statistics - Job status badges (completed, failed, running) - Dry run and break-glass indicators - Size and duration formatting - Add StorageAnalytics.test.tsx with 12 tests covering: - Loading state display - Analytics data rendering - Lifecycle methods (loadAnalytics, loadDiagnostics) - Size formatting for storage metrics - Diagnostics display (recommendations, warnings, capabilities) - Empty analytics handling - Component lifecycle (locationId and bucket changes) All 26 tests passing successfully. Related to #9
Now that all cleanup component tests are implemented and passing, remove the temporary exclusion from coverage configuration. Test coverage: - CleanupDashboard: 37 tests - ScanResults: 16 tests - JobMonitor: 14 tests - StorageAnalytics: 12 tests - cleanupStore: 26 tests Total: 105 cleanup-related tests passing Related to #9
- Remove unused imports (Assertion, AsymmetricMatchersContaining) - Add eslint-disable comments for empty interface extensions - All lint checks now passing Fixes CI lint failures in PR #9
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes comprehensive unit test coverage for all cleanup UI components, bringing total cleanup-related tests to 105 passing tests.
Changes Made
1. CleanupDashboard Tests (37 tests)
2. ScanResults Tests (16 tests)
3. JobMonitor Tests (14 tests)
4. StorageAnalytics Tests (12 tests)
5. Type Declarations
6. Configuration Update
Test Results
Testing Performed
Breaking Changes
None - this is purely additive test coverage.
Dependencies
No new dependencies added.
Checklist
Related Issues
Continues work from PR #8 (cleanupStore tests)
Screenshots/Logs
N/A - Test implementation
Deployment Notes
No deployment changes required - test-only PR.