/** * Component tests for TaskStatusPie. * Validates rendering with various data distributions. */ import { describe, it, expect } from 'vitest'; import { mount } from '@vue/test-utils'; import TaskStatusPie from '@/components/charts/TaskStatusPie.vue'; describe('TaskStatusPie', () => { it('should mount with default props', () => { const wrapper = mount(TaskStatusPie); expect(wrapper.exists()).toBe(true); }); it('should mount with realistic data', () => { const wrapper = mount(TaskStatusPie, { props: { data: { todo: 12, inProgress: 8, review: 5, done: 35 }, }, }); expect(wrapper.find('.task-status-pie').exists()).toBe(true); }); it('should handle all-zero data gracefully', () => { const wrapper = mount(TaskStatusPie, { props: { data: { todo: 0, inProgress: 0, review: 0, done: 0 }, }, }); expect(wrapper.exists()).toBe(true); }); it('should handle single-status data', () => { const wrapper = mount(TaskStatusPie, { props: { data: { todo: 0, inProgress: 0, review: 0, done: 50 }, }, }); expect(wrapper.exists()).toBe(true); }); });