/** * Component tests for PRMergeTimeChart. * Validates rendering with PR merge time data. */ import { describe, it, expect } from 'vitest'; import { mount } from '@vue/test-utils'; import PRMergeTimeChart from '@/components/charts/PRMergeTimeChart.vue'; const mockWeeks = [ { weekStart: '2026-03-02', avgHours: 18.5, prCount: 6 }, { weekStart: '2026-03-09', avgHours: 24.2, prCount: 8 }, { weekStart: '2026-03-16', avgHours: 52.1, prCount: 4 }, { weekStart: '2026-03-23', avgHours: 36.8, prCount: 10 }, ]; describe('PRMergeTimeChart', () => { it('should mount with weeks data', () => { const wrapper = mount(PRMergeTimeChart, { props: { weeks: mockWeeks }, }); expect(wrapper.exists()).toBe(true); }); it('should have chart container', () => { const wrapper = mount(PRMergeTimeChart, { props: { weeks: mockWeeks }, }); expect(wrapper.find('.pr-merge-time-chart').exists()).toBe(true); }); it('should handle custom warning threshold', () => { const wrapper = mount(PRMergeTimeChart, { props: { weeks: mockWeeks, warningThreshold: 24 }, }); expect(wrapper.exists()).toBe(true); }); it('should handle empty weeks', () => { const wrapper = mount(PRMergeTimeChart, { props: { weeks: [] }, }); expect(wrapper.exists()).toBe(true); }); });