Problem
The Seed editor is a complex, interaction-heavy block editor based on Tiptap/BlockNote and with our own custom schema. Recent regressions around copy-paste, link toolbar and list interactions have shown the need for automated tests for the editor package.
Solution
This project proposes building a Playwright end-to-end test suite that can simulate realistic editing flows and verify the Prosemirror editor state between transactions. This will provide a stable foundation for preventing regressions and improving reliability in the editor. Most editor functionality is pure DOM behavior, so browser E2E tests should be sufficient, however unit tests built on Vitest to cover editor commands and util functions can also be added in the future, after the E2E foundation is implemented.
Implementation
The following editor areas should have tests coverage added to them:
Copy-paste of content from both Seed documents and external sources
Plain text
Multi-line text
HTML
Markdown
Lists and blockquotes
Seed block types
Selection changes
Text selections
Node selections (node level blocks such as media blocks, embeds, query blocks)
Selections with arrow keys
Selections with mouse
Selection when moving between different block types
Block Insertion, Modification and Deletion
Inserting blocks using slash menu.
Modifying block attributes.
Deleting blocks using Backspace and Delete.
Verifying document structure through ProseMirror state.
Toolbars
Formatting toolbar and its' functions
Link preview/editing toolbar and its' functions
Menus
Slash menu
Link menu
Drag and drop
Here I'm not sure if browser editor test environment is different from electron for dragging files from the file system.
An initial solution should start with
Basic block insertion and deletion
Copy/paste scenarios
Selection and toolbar behavior
Rabbit holes
Clipboard API inconsistencies
Toolbar visibility timing on hover
Pasting from external sources will probably be hard coded content