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