mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-18 07:13:13 +00:00
fix(ui): refine page transitions and bulk actions
This commit is contained in:
@@ -3,6 +3,8 @@ import {
|
||||
canPauseDownload,
|
||||
canRedownload,
|
||||
canStartDownload,
|
||||
countDownloadActions,
|
||||
formatDownloadActionCount,
|
||||
getPauseResumeAction,
|
||||
isIdentityLocked,
|
||||
isTransferLocked,
|
||||
@@ -48,4 +50,24 @@ describe('download action policy', () => {
|
||||
expect(isIdentityLocked('completed')).toBe(true);
|
||||
expect(isTransferLocked('completed')).toBe(false);
|
||||
});
|
||||
|
||||
it('counts only eligible actions for a multi-selection', () => {
|
||||
const counts = countDownloadActions([
|
||||
{ status: 'queued' },
|
||||
{ status: 'downloading' },
|
||||
{ status: 'paused' },
|
||||
{ status: 'ready' },
|
||||
{ status: 'staged' },
|
||||
{ status: 'failed' },
|
||||
{ status: 'completed' },
|
||||
]);
|
||||
|
||||
expect(counts).toEqual({ pause: 2, resume: 4 });
|
||||
});
|
||||
|
||||
it('keeps large action badges compact without changing the accessible count', () => {
|
||||
expect(formatDownloadActionCount(2)).toBe('2');
|
||||
expect(formatDownloadActionCount(99)).toBe('99');
|
||||
expect(formatDownloadActionCount(100)).toBe('99+');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user