Sha256: 8972ededbb0ece3e8abb96f145e300624de7813309a9d2392a26db9871ebb394

Contents?: true

Size: 1.69 KB

Versions: 22

Compression:

Stored size: 1.69 KB

Contents

# frozen_string_literal: true

describe 'Metadata Administration', js: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:admin) { FactoryBot.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

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.3.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.2.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.1.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.3 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/features/javascript/metadata_admin_spec.rb