stat filter
Gitea Actions Demo / Deploy (push) Successful in 28s

This commit is contained in:
vadim committed 2026-09-28 17:35:03 +03:00
1 parent 40d579cdb9
commit 382cafa152
8 files changed
+25 -9

No files matched your search

@@ -44,4 +44,13 @@ describe('GetIssueStatsUseCase', () => {
expect(stats.total).toBe(0);
expect(stats.byStatus.every((entry) => entry.count === 0)).toBe(true);
});
it('passes projectId through to the repository to filter stats by project', async () => {
vi.mocked(repository.countByStatus).mockResolvedValue([{ status: 'OPEN', count: 3 }]);
const stats = await useCase.execute('user-1', 'project-1');
expect(repository.countByStatus).toHaveBeenCalledWith('user-1', 'project-1');
expect(stats.total).toBe(3);
});
});