From bb50de9f27e3fe67ba62e6a8828ec99bd88831f2 Mon Sep 17 00:00:00 2001 From: Muse Sweep Date: Sun, 25 Oct 2026 00:00:57 +0000 Subject: [PATCH] fix(id-web): generalise goto-line test helper to base Schema/Node types Fixes #821 createViewFromDoc was typed with typeof rawSchema, the narrow Schema<"text"|"code_block"|"doc", never>, which rejects richSchema at the call sites in goto-line.test.ts:354 and :394 (TS2345). Generalise it to the base prosemirror-model types Schema and Node (as PMNode), matching editor.ts getSchema's return type. --- pkgs/id/web/src/goto-line.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/id/web/src/goto-line.test.ts b/pkgs/id/web/src/goto-line.test.ts index 4201d16c87..0b18ed5725 100644 --- a/pkgs/id/web/src/goto-line.test.ts +++ b/pkgs/id/web/src/goto-line.test.ts @@ -4,6 +4,7 @@ * Tests plugin creation, dialog lifecycle, and command execution. */ +import type { Node as PMNode, Schema } from "prosemirror-model"; import { EditorState } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; import { afterEach, describe, expect, it } from "vitest"; @@ -320,8 +321,8 @@ describe("dialog input interaction", () => { describe("go-to-line across textblocks (#745)", () => { /** Create a view from a pre-built doc node (any schema). */ function createViewFromDoc( - schema: typeof rawSchema, - doc: ReturnType, + schema: Schema, + doc: PMNode, ): { view: EditorView; container: HTMLElement;