Skip to content

refactor(text-editor): extract editor-config to enable real-stack testing#4139

Draft
john-traas wants to merge 3 commits into
mainfrom
text-editor-real-stack-tests
Draft

refactor(text-editor): extract editor-config to enable real-stack testing#4139
john-traas wants to merge 3 commits into
mainfrom
text-editor-real-stack-tests

Conversation

@john-traas

Copy link
Copy Markdown
Contributor

What

Extracts the text editor's schema and plugin assembly out of the limel-prosemirror-adapter component into a pure, importable module, and adds an integration test that exercises the real editor stack.

  • refactor: initializeSchema() / createEditorState() (private methods on the adapter) → pure buildEditorSchema() / buildEditorPlugins() in editor-config.ts. The component delegates to them; plugin order and behaviour are preserved exactly.
  • test: editor-config.spec.ts builds the production schema + the real ordered plugin list and asserts, using the official prosemirror-test-builder:
    • commands produce the expected transaction;
    • the link/image handlePaste ordering contract (ProseMirror is first-truthy-wins) — guarding against a new/changed plugin silently shadowing another on a shared event;
    • a transaction sequence keeps the document structurally valid.
  • build: adds a clean script (shx rm -rf .stencil dist www) and the prosemirror-test-builder dev 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-dist issues), and needs no bespoke test-harness suite.

Verification

  • npm run test:spec: 884/884 pass (incl. the new spec)
  • text-editor e2e: 14/14 pass
  • Behaviour-preserving: no plugin order or logic changes.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d02c5938-cc78-4a08-b6df-2b112c303822

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch text-editor-real-stack-tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-4139/

@john-traas john-traas force-pushed the text-editor-real-stack-tests branch from b817bc0 to 74f39e1 Compare June 17, 2026 13:22
@john-traas john-traas self-assigned this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants