Sha256: 6758d674725c204c85701e3554fb27fde6c7365a98c6a1d13e125c2449a35690
Contents?: true
Size: 706 Bytes
Versions: 9
Compression:
Stored size: 706 Bytes
Contents
require 'spec_helper' if opal? RSpec.describe React::Test::Utils do it 'simulates' do stub_const 'Foo', Class.new Foo.class_eval do include React::Component def render div { 'Click Me' }.on(:click) { |e| click(e) } end end instance = React::Test::Utils.render_into_document(React.create_element(Foo)) expect(instance).to receive(:click) described_class.simulate(:click, instance.dom_node) end describe "render_into_document" do it "works with native element" do expect { described_class.render_into_document(React.create_element('div')) }.to_not raise_error end end end end
Version data entries
9 entries across 9 versions & 1 rubygems