fix: prevent double-counting orphaned pages in conflicting scenarios

This commit is contained in:
meels
2026-07-28 13:17:51 +02:00
parent 80ef971d1a
commit 7958d225d5
2 changed files with 19 additions and 3 deletions

View File

@@ -82,6 +82,17 @@ test("derivePipeline routes a duplicate raw-path claim to orphaned", () => {
assert.deepEqual(out.orphaned.map((p) => p.name), ["second.md"]);
});
test("derivePipeline lists a page once when it is both a duplicate claim and missing its raw file", () => {
const out = derivePipeline({
rawFiles: [{ path: "raw/sources/other.md", name: "other.md", size: 10 }],
sourcePages: [
{ path: "wiki/sources/first.md", name: "first.md", rawPath: "raw/sources/gone.md" },
{ path: "wiki/sources/second.md", name: "second.md", rawPath: "raw/sources/gone.md" },
],
});
assert.deepEqual(out.orphaned.map((p) => p.name), ["first.md", "second.md"]);
});
test("derivePipeline sorts unprocessed by name and processed newest first", () => {
const out = derivePipeline({
rawFiles: [