devperf/frontend/__tests__/components/TaskStatusPie.test.ts
zyc 44464dd334 feat: DevPerf Dashboard 研发人效看板 v1.0
- 后端:Bun + Hono + Drizzle ORM + SQLite
- 前端:Vue 3 + Naive UI + ECharts
- 项目管理:创建项目 + 绑定 Git 仓库
- OKR 系统:目标/关键结果 CRUD + 进度追踪
- Git 同步:Gitea API 自动同步 commit/PR + 作者关联
- 数据看板:项目 OKR 进度 + KR 状态分布 + 代码活动
- 权限体系:admin/manager/developer/viewer 四级
- Docker 部署:docker-compose + nginx

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 17:57:14 +08:00

42 lines
1.1 KiB
TypeScript

/**
* 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);
});
});