Sha256: c369d25935f8ead955f37992b164d9c7bfebd6110cd4a84377880370bc169eeb

Contents?: true

Size: 1.83 KB

Versions: 19

Compression:

Stored size: 1.83 KB

Contents

describe 'Multi image selector', type: :feature, js: true, versioning: true, default_max_wait_time: 5 do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
  let(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
  before { login_as exhibit_curator }

  it 'allows the user to select which image in a multi image object to display' do
    visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)

    add_widget 'solr_documents' # the "Item Row" widget

    fill_in_typeahead_field with: 'xd327cm9378'

    expect(page).to have_selector '.panel'

    within('.panel') do
      expect(page).to have_content(/Image \d of \d/)
      expect(page).to have_link 'Change'
    end

    save_page

    visit spotlight.exhibit_feature_page_path(exhibit, feature_page)
    expect(page).to have_css("[data-id='xd327cm9378']")
    expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0001/full/!400,400/0/default.jpg']")
    expect(page).to_not have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0002/full/!400,400/0/default.jpg']")

    click_link('Edit')

    within('.panel') do
      expect(page).to have_content(/Image \d of \d/)
      find('a', text: 'Change').click
    end

    expect(page).to have_css('.thumbs-list ul', visible: true)

    within('.thumbs-list ul') do
      all('li')[1].click
    end

    save_page

    expect(page).to have_css("[data-id='xd327cm9378']")
    expect(page).to_not have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0001/full/!400,400/0/default.jpg']")
    expect(page).to have_css("img[src='https://stacks.stanford.edu/image/iiif/xd327cm9378%2Fxd327cm9378_05_0002/full/!400,400/0/default.jpg']")
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.4.0 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.3.3 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.3.2 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.3.1 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.3.0 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.2.1 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.2.0 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.1.0 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.2 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.1 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/features/javascript/multi_image_select_spec.rb
blacklight-spotlight-1.5.1 spec/features/javascript/multi_image_select_spec.rb