Sha256: f35e4b1ab721175f04a52bbb8d03456bc209dcfd134bad726f3d5f5115b4321a

Contents?: true

Size: 1.65 KB

Versions: 15

Compression:

Stored size: 1.65 KB

Contents

feature '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

15 entries across 15 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.5.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.4.1 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.4.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.3.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.2.0 spec/features/javascript/metadata_admin_spec.rb
blacklight-spotlight-1.1.0 spec/features/javascript/metadata_admin_spec.rb