feat(downloads): add details controls and aggregate summaries

This commit is contained in:
NimBold
2026-07-23 02:31:34 +03:30
parent 9d737598c6
commit f4e5e211cc
13 changed files with 480 additions and 1 deletions
+13
View File
@@ -3,6 +3,7 @@ import {
canPauseDownload,
canRedownload,
canStartDownload,
getPauseResumeAction,
isIdentityLocked,
isTransferLocked,
startActionLabel,
@@ -27,6 +28,18 @@ describe('download action policy', () => {
expect(canRedownload('downloading')).toBe(false);
});
it('only exposes pause or resume for the details-view toggle', () => {
expect(getPauseResumeAction('queued')).toBe('pause');
expect(getPauseResumeAction('downloading')).toBe('pause');
expect(getPauseResumeAction('processing')).toBe('pause');
expect(getPauseResumeAction('retrying')).toBe('pause');
expect(getPauseResumeAction('paused')).toBe('resume');
for (const status of ['ready', 'staged', 'completed', 'failed'] as const) {
expect(getPauseResumeAction(status)).toBeNull();
}
});
it('provides consistent labels and edit locks', () => {
expect(startActionLabel('ready')).toBe('Start');
expect(startActionLabel('failed')).toBe('Start');