Sha256: 564af9fd462fa4e188b94494f254d2bd9806d0574aa046d79aee9630ad364665

Contents?: true

Size: 1.65 KB

Versions: 33

Compression:

Stored size: 1.65 KB

Contents

feature 'Metadata Administration', js: true do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:admin) { FactoryGirl.create(:exhibit_admin, exhibit: exhibit) }
  before { login_as admin }
  describe 'Select/Deselect all button' do
    it 'deselects all checkboxes when all are selected' do
      visit spotlight.edit_exhibit_metadata_configuration_path exhibit
      # No checkboxes should be unchecked
      expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
      within('tr th:nth-child(2)') do
        click_button 'Deselect all'
        expect(page).to have_css('button', text: 'Select all', visible: true)
      end
      # No checkboxes should be checked
      expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:checked")
    end
    it 'selects all checkboxes when any are unselected' do
      visit spotlight.edit_exhibit_metadata_configuration_path exhibit
      # No checkboxes should be unchecked
      expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
      first_button_area = find('tr th:nth-child(2)')
      within first_button_area do
        expect(page).to have_css('button', text: 'Deselect all')
      end
      # Uncheck first checkbox
      find("tr:first-child td:nth-child(2) input[type='checkbox']").set(false)
      # A checkbox should be checked
      expect(page).to have_css("tr td:nth-child(2) input[type='checkbox']:checked")
      within first_button_area do
        click_button 'Select all'
      end
      # No checkboxes should be unchecked
      expect(page).not_to have_css("tr td:nth-child(2) input[type='checkbox']:not(:checked)")
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.34.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.34.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.33.3 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.33.2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.33.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.33.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.32.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.31.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.30.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.29.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.29.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.28.3 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.28.2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.28.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.28.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.27.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-0.26.1 spec/features/javascript/metadata_admin_spec.rb