Skip to content

[audit] test-gap: multi-cursor undo/redo integration with ProseMirror history #313

@claude

Description

@claude

Problem

The multi-cursor plugin has 18 test files with good coverage of individual operations (typing, deletion, clipboard, arrow movement, soft undo). However, there is no integration test that verifies undo/redo behavior with ProseMirror's history() plugin.

What's missing

  • Does Cmd+Z after a multi-cursor edit correctly undo all cursor changes as a single step?
  • Does undo restore the MultiSelection correctly? (This depends on toJSON/fromJSON roundtrip, which is tested individually, but not through the history plugin path)
  • Does Cmd+Z after multiple sequential multi-cursor edits produce correct incremental undo?

The toJSON/fromJSON and Selection.jsonID("multi", MultiSelection) registration are tested, but the actual history plugin integration (which serializes selections through this path) is not exercised end-to-end.

Suggested fix

Add integration tests that include ProseMirror's history() plugin in the test editor state and verify:

  1. Multi-cursor edit → undo restores both document content and MultiSelection
  2. Multiple sequential edits → incremental undo works correctly
  3. Undo → redo roundtrip preserves MultiSelection with correct backward flags

Directory: src/plugins/multiCursor/__tests__/

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditCodebase audit findingtest-gapMissing or insufficient test coverage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions