refactor(text-editor): extract editor-config to enable real-stack testing#4139
refactor(text-editor): extract editor-config to enable real-stack testing#4139john-traas wants to merge 3 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-4139/ |
b817bc0 to
74f39e1
Compare
What
Extracts the text editor's schema and plugin assembly out of the
limel-prosemirror-adaptercomponent into a pure, importable module, and adds an integration test that exercises the real editor stack.initializeSchema()/createEditorState()(private methods on the adapter) → purebuildEditorSchema()/buildEditorPlugins()ineditor-config.ts. The component delegates to them; plugin order and behaviour are preserved exactly.editor-config.spec.tsbuilds the production schema + the real ordered plugin list and asserts, using the officialprosemirror-test-builder:handlePasteordering contract (ProseMirror is first-truthy-wins) — guarding against a new/changed plugin silently shadowing another on a shared event;cleanscript (shx rm -rf .stencil dist www) and theprosemirror-test-builderdev dependency.Why
The editor is now used across the CRM, so we need regression coverage for cross-plugin interactions (paste / keymap / transaction chains). Those only surface when the real, full plugin set runs against the real schema — previously impossible because the schema and plugin list were private to the component. This unblocks that, tests against source (immune to stale-
distissues), and needs no bespoke test-harness suite.Verification
npm run test:spec: 884/884 pass (incl. the new spec)🤖 Generated with Claude Code