mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 10:49:29 +00:00
feat(downloads): add details controls and aggregate summaries
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user