Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

754 B
Raw Blame
import {describe, it} from "node:test";
import * as assert from "node:assert/strict";
import {getCreateTargetContext, isSameCreateTargetContext} from "./createTargetContext";

describe("create target context", () => {
    it("treats missing lite editor context as empty context", () => {
        const context = getCreateTargetContext({} as IProtyle);

        assert.equal(isSameCreateTargetContext(context, {} as IProtyle), true);
    });

    it("detects document context changes", () => {
        const context = getCreateTargetContext({notebookId: "box", path: "/old.sy"} as IProtyle);

        assert.equal(isSameCreateTargetContext(context, {
            notebookId: "box",
            path: "/new.sy",
        } as IProtyle), false);
    });
});