require 'spec_helper' describe 'Hyperloop::Vis::Component', js: true do it 'creates a component by using the mixin and renders it' do mount 'OuterComponent' do class VisComponent include Hyperloop::Vis::Network::Mixin render_with_dom_node do |dom_node, data| net = Vis::Network.new(dom_node, data) end end class OuterComponent < Hyperloop::Component render do data = Vis::DataSet.new([{id: 1, name: 'foo'}, {id: 2, name: 'bar'}, {id: 3, name: 'pub'}]) DIV { VisComponent(vis_data: {nodes: data})} end end end expect(page.body).to include(' true, :locale => 'en', :nodes => { :scaling => { :min => 16, :max => 32 }, :shadow => true }, :edges => { :color => "#ff0000", :smooth => false, :shadow => true } } DIV { VisComponent(vis_data: {nodes: data}, options: options)} end end end expect(page.body).to include('