26 lines
788 B
TypeScript
26 lines
788 B
TypeScript
import '@testing-library/jest-dom/vitest';
|
|
import { render, screen } from '@testing-library/svelte';
|
|
import { describe, expect, it } from 'vitest';
|
|
import ProjectDashboard from './ProjectDashboard.svelte';
|
|
|
|
describe('ProjectDashboard', () => {
|
|
it('shows project counters', () => {
|
|
render(ProjectDashboard, {
|
|
props: {
|
|
summary: {
|
|
project_id: 1,
|
|
pending_inbox_count: 2,
|
|
open_task_count: 5,
|
|
recent_note_count: 3,
|
|
recent_session_count: 4,
|
|
},
|
|
},
|
|
});
|
|
|
|
expect(screen.getByText('待处理 Inbox')).toBeInTheDocument();
|
|
expect(screen.getByText('2')).toBeInTheDocument();
|
|
expect(screen.getByText('当前任务')).toBeInTheDocument();
|
|
expect(screen.getByText('5')).toBeInTheDocument();
|
|
});
|
|
});
|