/** * Component tests for KPIRadarChart. * Validates rendering with KPI scorecard data. */ import { describe, it, expect } from 'vitest'; import { mount } from '@vue/test-utils'; import KPIRadarChart from '@/components/charts/KPIRadarChart.vue'; const mockScorecard = { sprintDeliveryRate: 82, avgDeliveryDays: 4.5, bugDensity: 0.08, prMergeTimeAvg: 24, reviewParticipation: 75, activityStreak: 12, }; describe('KPIRadarChart', () => { it('should mount with scorecard data', () => { const wrapper = mount(KPIRadarChart, { props: { scorecard: mockScorecard }, }); expect(wrapper.exists()).toBe(true); }); it('should have chart container', () => { const wrapper = mount(KPIRadarChart, { props: { scorecard: mockScorecard }, }); expect(wrapper.find('.kpi-radar-chart').exists()).toBe(true); }); it('should handle null scorecard', () => { const wrapper = mount(KPIRadarChart, { props: { scorecard: null }, }); expect(wrapper.exists()).toBe(true); }); it('should handle extreme values', () => { const wrapper = mount(KPIRadarChart, { props: { scorecard: { sprintDeliveryRate: 100, avgDeliveryDays: 0, bugDensity: 0, prMergeTimeAvg: 0, reviewParticipation: 100, activityStreak: 365, }, }, }); expect(wrapper.exists()).toBe(true); }); it('should handle all-zero values', () => { const wrapper = mount(KPIRadarChart, { props: { scorecard: { sprintDeliveryRate: 0, avgDeliveryDays: 0, bugDensity: 0, prMergeTimeAvg: 0, reviewParticipation: 0, activityStreak: 0, }, }, }); expect(wrapper.exists()).toBe(true); }); });