fix: align live speed and split package reset
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user