Skip to content

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

989 B
Raw Blame
import {describe, it} from "node:test";
import * as assert from "node:assert/strict";
import {shouldCheckOtherWindows} from "./openFileWindow";

describe("cross-window file opening", () => {
    it("checks other windows for regular file opening", () => {
        assert.equal(shouldCheckOtherWindows({}), true);
    });

    it("keeps the existing split-position behavior", () => {
        assert.equal(shouldCheckOtherWindows({position: "right"}), false);
        assert.equal(shouldCheckOtherWindows({position: "bottom"}), false);
        assert.equal(shouldCheckOtherWindows({position: "right", assetPath: "assets/test.pdf"}), true);
    });

    it("stays in the target window when explicitly requested", () => {
        assert.equal(shouldCheckOtherWindows({forceCurrentWindow: true}), false);
        assert.equal(shouldCheckOtherWindows({
            position: "right",
            assetPath: "assets/test.pdf",
            forceCurrentWindow: true,
        }), false);
    });
});