/** * Component tests for BurndownChart. * Validates rendering with burndown data points. */ import { describe, it, expect } from 'vitest'; import { mount } from '@vue/test-utils'; import BurndownChart from '@/components/charts/BurndownChart.vue'; const mockBurndown = [ { date: '2026-04-01', ideal: 100, actual: 100 }, { date: '2026-04-03', ideal: 80, actual: 85 }, { date: '2026-04-05', ideal: 60, actual: 70 }, { date: '2026-04-07', ideal: 40, actual: 55 }, { date: '2026-04-09', ideal: 20, actual: 35 }, { date: '2026-04-11', ideal: 0, actual: 10 }, ]; describe('BurndownChart', () => { it('should mount with burndown data', () => { const wrapper = mount(BurndownChart, { props: { burndown: mockBurndown, sprintName: 'Sprint 5' }, }); expect(wrapper.exists()).toBe(true); }); it('should have chart container', () => { const wrapper = mount(BurndownChart, { props: { burndown: mockBurndown }, }); expect(wrapper.find('.burndown-chart').exists()).toBe(true); }); it('should handle empty burndown gracefully', () => { const wrapper = mount(BurndownChart, { props: { burndown: [] }, }); expect(wrapper.exists()).toBe(true); }); it('should handle single data point', () => { const wrapper = mount(BurndownChart, { props: { burndown: [{ date: '2026-04-01', ideal: 50, actual: 50 }] }, }); expect(wrapper.exists()).toBe(true); }); });