# require 'rails_helper'
#
# describe 'welcome/index.html.erb', :js => true do
#
#   before do
#     #visit root_path
#     visit testbox_path('original')
#     # visit testbox_path('minimal_json')
#   end
#
#   describe 'dynamic chart' do
#
#     before do
#       @chart_container = page.find('div.dynamic_chart')
#     end
#
#     it { expect(page).to have_content(@introText) }
#
#     it { expect(page).to have_selector('body select') }
#
#     context 'when no option selected' do
#       it { expect(@chart_container).not_to have_selector('svg') }
#     end
#
#     context 'when option selected' do
#
#       before do
#         find('select').find(:xpath, 'option[8]').select_option
#       end
#
#       it {expect(@chart_container).to have_selector('svg')}
#
#       it do
#         expect(@chart_container.find_all('svg').length).to equal(3)
#       end
#
#       context 'when there is an extreme Outlier label' do
#
#         before do
#           @extremeOutlierLabel = first('text.extremeOutlierLabel')
#         end
#
#         context 'when not hovering over extreme Outlier label' do
#           it { expect(page).not_to have_selector('div.toolbox')  }
#         end
#
#         context 'when hovering over extreme Outlier label' do
#           before do
#             sleep 2
#             @extremeOutlierLabel.hover
#             # page.save_and_open_screenshot
#           end
#
#           it { expect(page).to have_selector('div.tooltip') }
#
#         end
#
#       end
#
#     end
#
#
#   end
#
#   describe 'static chart' do
#
#     before do
#       @chart_container = page.find('div.static_chart')
#     end
#
#     it { expect(@chart_container).to have_selector('svg') }
#
#     it { expect(@chart_container).not_to have_selector('select')}
#
#   end
#
# end
