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

Commit 46ddcbc

Browse files
committed
Add test for #110
1 parent f593f26 commit 46ddcbc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/react/component_spec.rb

+16
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,22 @@ def render
571571

572572
expect(element.refs.field.value).to eq('some_stuff')
573573
end
574+
575+
it "allows access the actual DOM node" do
576+
Foo.class_eval do
577+
after_mount do
578+
dom = refs[:my_div].dom_node
579+
`dom.innerHTML = 'Modified'`
580+
end
581+
582+
def render
583+
React.create_element('div', ref: :my_div) { "Original Content" }
584+
end
585+
end
586+
587+
instance = renderToDocument(Foo)
588+
expect(`#{instance.dom_node}.innerHTML`).to eq('Modified')
589+
end
574590
end
575591

576592
describe '#render' do

0 commit comments

Comments
 (0)