Skip to content

Commit 302d4c0

Browse files
committed
test spec for #63
1 parent 4192c30 commit 302d4c0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ruby/hyper-component/spec/client_features/component_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,23 @@ class Foo < Hyperloop::Component
237237
expect(page).to have_content("paramchildparamchild")
238238
end
239239

240+
it 'can receive and render a component class' do
241+
mount 'Baz' do
242+
class Bar < Hyperloop::Component
243+
param :p
244+
render { @P.span }
245+
end
246+
class Foo < Hyperloop::Component
247+
param :c
248+
render { @C.insert_element(p: 123) }
249+
end
250+
class Baz < Hyperloop::Component
251+
render { Foo(c: Bar) }
252+
end
253+
end
254+
expect(page).to have_content("123")
255+
end
256+
240257
it 'has a class components method' do
241258
mount 'Foo' do
242259
class Bar < Hyperloop::Component

0 commit comments

Comments
 (0)