vicky469_aside/tests/canonicalCommentStorage.test.ts
vicky469 3b70785b89 refactor: drop legacy comment storage
Remove runtime support for old plugin names, URI protocols, inline note blocks, and legacy sidecar paths. Users who still need inline migration must upgrade through the previous release first.
2026-06-12 11:07:00 +08:00

29 lines
840 B
TypeScript

import * as assert from "node:assert/strict";
import test from "node:test";
import {
planCanonicalCommentStorage,
} from "../src/core/storage/canonicalCommentStorage";
test("canonical comment storage planner uses current sidecar records when present", () => {
const plan = planCanonicalCommentStorage({
sidecarRecordFound: true,
});
assert.deepEqual(plan, {
action: "use-sidecar",
source: "sidecar",
shouldRecoverRenamedSource: false,
});
});
test("canonical comment storage planner checks current rename recovery when no sidecar exists", () => {
const plan = planCanonicalCommentStorage({
sidecarRecordFound: false,
});
assert.deepEqual(plan, {
action: "check-renamed-source",
source: "none",
shouldRecoverRenamedSource: true,
});
});