feat(upload): support grouping upload tasks by day and displaying uploader name

This commit is contained in:
yiling
2026-06-01 11:06:40 +08:00
parent 8175e903fd
commit 104b162be4
4 changed files with 163 additions and 18 deletions
+18
View File
@@ -310,4 +310,22 @@ describe('UploadService', () => {
const parentFolder = await prisma.asset.findUnique({ where: { id: parentId } })
expect(parentFolder?.sizeByte).toBe(3000)
})
it('should list upload tasks and include the creator name as uploaderName', async () => {
const task = await prisma.task.create({
data: {
creatorId: userId,
total: 3,
uploaded: 1,
type: 'upload',
name: 'test-upload-task',
},
})
const result = await uploadService.listUploadTasks(userId, { first: 10 })
expect(result.data).toHaveLength(1)
expect(result.data[0].id).toBe(task.id)
expect(result.data[0].name).toBe('test-upload-task')
expect(result.data[0].uploaderName).toBe('test')
})
})