fix(downloads): harden queue drag and reorder behavior

This commit is contained in:
NimBold
2026-07-23 07:40:02 +03:30
parent 18e9200b74
commit 9302911ac7
6 changed files with 388 additions and 51 deletions
+5
View File
@@ -13,6 +13,11 @@ describe('queue ordering', () => {
.toEqual(['a', 'b', 'd', 'c']);
});
it('moves a selected block to the end for a downward drop', () => {
expect(moveSelectedBlockToIndex(items, ['b', 'c'], 2).map(item => item.id))
.toEqual(['a', 'd', 'b', 'c']);
});
it('translates pointer boundaries after selected rows are removed', () => {
expect(targetIndexForBoundary(items, ['b', 'd'], 2)).toBe(1);
expect(targetIndexForBoundary(items, ['b', 'd'], 3)).toBe(2);