fix: align live speed and split package reset

This commit is contained in:
Sucukdeluxe
2026-08-31 18:21:58 +02:00
parent 217b7b026e
commit f14d166898
9 changed files with 270 additions and 85 deletions
+17
View File
@@ -17,6 +17,8 @@ import {
getRemainingDownloadBytes,
getPendingDownloadItemCount,
getDownloadSpeedBps,
getPackageErrorItemIds,
isDownloadItemError,
buildDownloadLogicalRows,
type DownloadSidebarFilter,
type DownloadsModelInput
@@ -888,6 +890,21 @@ describe("downloads model", () => {
expect(getDownloadSpeedBps({ stale: -1, invalid: Number.NaN })).toBe(0);
});
it("selects only failed downloads and extraction errors for a package error reset", () => {
const packageEntry = pkg("package-a", "Reset", ["successful", "download-error", "extract-error"]);
const items = {
successful: item("successful", packageEntry.id, "completed", { fullStatus: "Entpackt" }),
"download-error": item("download-error", packageEntry.id, "failed", { fullStatus: "Fehlgeschlagen nach 3 Versuchen" }),
"extract-error": item("extract-error", packageEntry.id, "completed", { fullStatus: "Entpack-Fehler: CRCERROR" })
};
expect(isDownloadItemError(items.successful)).toBe(false);
expect(getPackageErrorItemIds([packageEntry.id], { [packageEntry.id]: packageEntry }, items)).toEqual([
"download-error",
"extract-error"
]);
});
it("exports the sidebar filter contract used by the downloads shell", () => {
const filter: DownloadSidebarFilter = "queued";