Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit c141fd5

Browse files
catmandoajjahn
authored andcommitted
added test #103
1 parent f80a610 commit c141fd5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/react/dsl_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,28 @@ def render
134134

135135
expect(React.render_to_static_markup(React.create_element(Foo))).to eq('<div>Hello&nbsp;&nbsp;Goodby</div>')
136136
end
137+
138+
it "will remove all elements passed as params from the rendering buffer" do
139+
stub_const 'X2', Class.new
140+
X2.class_eval do
141+
include React::Component
142+
param :ele
143+
def render
144+
div do
145+
ele.render
146+
ele.render
147+
end
148+
end
149+
end
150+
stub_const 'Test', Class.new
151+
Test.class_eval do
152+
include React::Component
153+
def render
154+
X2(ele: b { "hello" })
155+
end
156+
end
157+
158+
expect(React.render_to_static_markup(React.create_element(Test))).to eq('<div><b>hello</b><b>hello</b></div>')
159+
end
137160
end
138161
end

0 commit comments

Comments
 (0)