Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DEV: move test to new 1-per-file strategy
  • Loading branch information
renato committed Dec 11, 2025
commit 95dee91aae7e3be3530f283a0bdd7841c6d862bb
53 changes: 53 additions & 0 deletions spec/system/composer/prosemirror_wrap_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# frozen_string_literal: true

describe "Composer - ProseMirror - Inline and Block Wrap", type: :system do
include_context "with prosemirror editor"

it "supports [wrap] to create a wrap block" do
open_composer
composer.type_content("[wrap]")

expect(rich).to have_css(".composer-wrap-node")
expect(rich).to have_content("Wrap content")

composer.toggle_rich_editor

expect(composer).to have_value("[wrap]\nWrap content\n\n[/wrap]\n\n")
end

it "supports [wrap=name] to create a named wrap block" do
open_composer
composer.type_content("[wrap=example]")

expect(rich).to have_css(".composer-wrap-node")
expect(rich).to have_content("Wrap content")

composer.toggle_rich_editor

expect(composer).to have_value("[wrap=example]\nWrap content\n\n[/wrap]\n\n")
end

it "supports [wrap class=foo] to create a wrap block with attributes" do
open_composer
composer.type_content("[wrap class=highlight]")

expect(rich).to have_css(".composer-wrap-node")

composer.toggle_rich_editor

expect(composer).to have_value("[wrap class=highlight]\nWrap content\n\n[/wrap]\n\n")
end

it "creates inline wrap when not at start of line" do
open_composer
composer.type_content("Text before [wrap=inline]")

expect(rich).to have_css(".composer-wrap-node")
expect(rich).to have_content("Text before")
expect(rich).to have_content("Wrap content")

composer.toggle_rich_editor

expect(composer).to have_value("Text before [wrap=inline]Wrap content[/wrap] ")
end
end
Loading