test(editor): fix type errors in the Tables tests #1151

Closed
kayg wants to merge 0 commits from fix/editor-tables-test-types into dev
Owner

Fixes the 11 TypeScript errors that packages/editor typecheck reports on dev after the Tables port. CI's Typecheck step runs the same command, so dev's CI was red.

Test files only. No product code and no tsconfig changes. No any, no @ts-ignore.

Causes and fixes

  • tables-update.test.ts, tables-cell-update.test.ts: the test cast tableCellEdit to Annotation<…> (the instance type). Annotation.define returns AnnotationType<…>, which owns .of(). Cast changed to AnnotationType. Annotation import dropped as unused.
  • tables-update.test.ts, tables-cell-update.test.ts: DecorationSet is type-only, and verbatimModuleSyntax requires import type.
  • embeds.test.ts: EditorView.decorations values are DecorationSet | ((view) => DecorationSet). The test calls the function form, so it narrows with a cast there.
  • tables-parser.test.ts: the Lezer Parser type has no parseInline, though the runtime parser has it. The spy goes through a local InlineParser type.

Gates (dev-01, ~/bin/slot, worktree at origin/fix/editor-tables-test-types 7f8caace7)

  • bun run --cwd packages/editor check (the CI command, tsc --noEmit && tsc --noEmit -p perf/tsconfig.json): exit 0. It reported the 11 errors before the fix.
  • bun run --cwd packages/editor test (vitest run): 58 files, 663 tests passed, exit 0.
  • bun run --cwd apps/web check: 0 errors, 19 warnings in 13 files. Identical on origin/dev 7edd99ff4 (same counts).

Not run: Playwright and the rest of CI. The change is type-only in test files.

🤖 Generated with Claude Code

Fixes the 11 TypeScript errors that `packages/editor` typecheck reports on dev after the Tables port. CI's Typecheck step runs the same command, so dev's CI was red. Test files only. No product code and no `tsconfig` changes. No `any`, no `@ts-ignore`. ## Causes and fixes - `tables-update.test.ts`, `tables-cell-update.test.ts`: the test cast `tableCellEdit` to `Annotation<…>` (the instance type). `Annotation.define` returns `AnnotationType<…>`, which owns `.of()`. Cast changed to `AnnotationType`. `Annotation` import dropped as unused. - `tables-update.test.ts`, `tables-cell-update.test.ts`: `DecorationSet` is type-only, and `verbatimModuleSyntax` requires `import type`. - `embeds.test.ts`: `EditorView.decorations` values are `DecorationSet | ((view) => DecorationSet)`. The test calls the function form, so it narrows with a cast there. - `tables-parser.test.ts`: the Lezer `Parser` type has no `parseInline`, though the runtime parser has it. The spy goes through a local `InlineParser` type. ## Gates (dev-01, `~/bin/slot`, worktree at origin/fix/editor-tables-test-types 7f8caace7) - `bun run --cwd packages/editor check` (the CI command, `tsc --noEmit && tsc --noEmit -p perf/tsconfig.json`): exit 0. It reported the 11 errors before the fix. - `bun run --cwd packages/editor test` (vitest run): 58 files, 663 tests passed, exit 0. - `bun run --cwd apps/web check`: 0 errors, 19 warnings in 13 files. Identical on origin/dev 7edd99ff4 (same counts). Not run: Playwright and the rest of CI. The change is type-only in test files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(editor): fix type errors in the Tables tests
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
7f8caace75
Annotation.define returns AnnotationType, which owns .of(); the tests cast to the
instance type. DecorationSet is type-only under verbatimModuleSyntax. The facet
entry is a function at runtime, so narrow it before calling. The Lezer Parser type
omits parseInline, so the spy goes through a local type.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Author
Owner

Merged into dev with --no-ff by the orchestrator (test-only type fixes; editor check clean, 663 tests). Closing.

Merged into `dev` with `--no-ff` by the orchestrator (test-only type fixes; editor check clean, 663 tests). Closing.
kayg closed this pull request 2026-11-15 02:43:18 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!1151
No description provided.