/**
* Cleanup Verification Report Component
*
* Displays detailed results of test data cleanup after integration tests complete.
* Shows tables cleaned, records deleted, errors, and verification status.
*/
import { CheckCircle2, XCircle, AlertCircle, Database, Trash2, Clock } from 'lucide-react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Progress } from '@/components/ui/progress';
import type { CleanupSummary } from '@/lib/integrationTests/testCleanup';
interface CleanupReportProps {
summary: CleanupSummary;
className?: string;
}
export function CleanupReport({ summary, className = '' }: CleanupReportProps) {
const successCount = summary.results.filter(r => !r.error).length;
const errorCount = summary.results.filter(r => r.error).length;
const successRate = summary.results.length > 0
? (successCount / summary.results.length) * 100
: 0;
return (
Total Deleted
{summary.totalDeleted.toLocaleString()}
Tables Cleaned
{successCount}/{summary.results.length}
Duration
Status
{result.table}
{result.error}
{errorCount} {errorCount === 1 ? 'table' : 'tables'} failed to clean
Check error messages above for details. Test data may remain in database.
Cleanup completed successfully
All test data has been removed from the database.
No test data found
Database is already clean or no test data was created during this run.
Cleanup: {summary.totalDeleted} records deleted
{summary.results.filter(r => !r.error).length}/{summary.results.length} tables cleaned {' • '} {(summary.totalDuration / 1000).toFixed(1)}s