Files
Multi-Debrid-Downloader/tests/extractor-password-progress.test.ts
T
Sucukdeluxe b8a7c24954 fix(extraction): make manual archive workflows deterministic
Scope selected item runs and stop mutations precisely, attach hybrid work to the active run, retain password progress, and report finalization with real percentages.

Drain stale post-processing before manual extraction, allow package and child extraction with open siblings, retry nonterminal hybrid archive attempts, and replace misleading aggregate retry counts with actionable conversion status.
2026-08-23 01:21:45 +02:00

22 lines
924 B
TypeScript

import { describe, expect, it } from "vitest";
import * as extractorModule from "../src/main/extractor";
describe("extractor password progress", () => {
it("retains the active password attempt across pulse and percentage updates", () => {
const merge = (extractorModule as Record<string, unknown>).mergeExtractPasswordProgress as ((
current: Record<string, unknown> | undefined,
update: Record<string, unknown> | undefined
) => Record<string, unknown> | undefined) | undefined;
expect(merge).toBeTypeOf("function");
if (!merge) return;
const secondAttempt = { passwordAttempt: 2, passwordTotal: 7 };
expect(merge(undefined, secondAttempt)).toEqual(secondAttempt);
expect(merge(secondAttempt, undefined)).toEqual(secondAttempt);
expect(merge(secondAttempt, { passwordAttempt: 3, passwordTotal: 7 })).toEqual({
passwordAttempt: 3,
passwordTotal: 7
});
});
});