import { render, screen } from '@testing-library/react';
import { describe, expect, it, vi } from 'vitest';
vi.mock('recharts', () => ({
Radar: () => null,
RadarChart: ({ children }: { children: React.ReactNode }) =>
{children}
,
PolarGrid: () => null,
PolarAngleAxis: () => null,
PolarRadiusAxis: () => null,
ResponsiveContainer: ({ children }: { children: React.ReactNode }) => {children}
,
Legend: () => null,
Tooltip: () => null,
}));
vi.mock('@/i18n/navigation', () => ({
Link: ({ children, ...props }: React.PropsWithChildren>) => {children},
}));
vi.mock('@/lib/hooks/use-khu-cong-nghiep', () => ({
useIndustrialCompare: () => ({ data: undefined, isLoading: false }),
useIndustrialParksSearch: () => ({ data: { data: [] } }),
}));
vi.mock('@/lib/khu-cong-nghiep-api', () => ({
PARK_STATUS_COLORS: { OPERATIONAL: 'bg-green-100 text-green-800' },
PARK_STATUS_LABELS: { OPERATIONAL: 'Hoạt động' },
REGION_LABELS: { SOUTH: 'Miền Nam' },
}));
import { ParkCompareClient } from '../park-compare-client';
describe('ParkCompareClient', () => {
it('renders heading', () => {
render();
expect(screen.getByText('So Sánh Khu Công Nghiệp')).toBeInTheDocument();
});
it('shows empty state when fewer than 2 parks selected', () => {
render();
expect(screen.getByText('Chọn ít nhất 2 KCN để so sánh')).toBeInTheDocument();
});
it('renders add park button', () => {
render();
expect(screen.getByText('Thêm KCN')).toBeInTheDocument();
});
});