- 后端: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>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
/**
|
|
* 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);
|
|
});
|
|
});
|