1 parent
40d579cdb9
commit
382cafa152
8 files changed
+25
-9
No files matched your search
+9
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user