mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(upload): support grouping upload tasks by day and displaying uploader name
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user