Skip to content

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

:bug: Restore document boundary keyboard test dependencies https://github.com/siyuan-note/siyuan/issues/20288

Danielf44c3084ee21
diff --git a/app/src/boot/globalEvent/readonlyKeydown.test.ts b/app/src/boot/globalEvent/readonlyKeydown.test.ts
index fed9f864c9..223737c5ce 100644
--- a/app/src/boot/globalEvent/readonlyKeydown.test.ts
+++ b/app/src/boot/globalEvent/readonlyKeydown.test.ts
@@ -13,7 +13,8 @@ const loadFunction = (path: string, name: string, globals: Record<string, unknow
compilerOptions: {module: ModuleKind.CommonJS, target: ScriptTarget.ES2021},
}).outputText;
const exports: any = {};
- runInNewContext(compiled, {exports, logKeyboardDiagnostic: (): void => undefined, ...globals});
+ runInNewContext(compiled, {exports, logKeyboardDiagnostic: (): void => undefined,
+ handleDocumentBoundaryHotkey: () => false, ...globals});
return exports.subject;
};
diff --git a/app/src/protyle/util/contextMenuHotkey.test.ts b/app/src/protyle/util/contextMenuHotkey.test.ts
index ec2e7ca681..5cfc224c97 100644
--- a/app/src/protyle/util/contextMenuHotkey.test.ts
+++ b/app/src/protyle/util/contextMenuHotkey.test.ts
@@ -110,6 +110,7 @@ test("startup adds context menu defaults and preserves an explicitly empty bindi
test("mobile leaves unhandled context menu shortcuts available to plugin dispatch", () => {
let dispatched = 0;
const mobileKeydown = loadFunction("src/mobile/util/keydown.ts", "mobileKeydown", {
+ getCurrentEditor: (): undefined => undefined,
window: {siyuan: {config: {keymap: {general: {openContextMenu: {custom: "⌘/"}}}}}},
filterHotkey: () => false,
matchHotKey: () => { throw new Error("Context menu must be handled locally"); },