Sha256: 29327cc75f624edb630081f5f2af2bfb050c27eb5a02c9cb051b6204bb8dd692

Contents?: true

Size: 1.62 KB

Versions: 40

Compression:

Stored size: 1.62 KB

Contents

# frozen_string_literal: true

describe 'Featured Pages Blocks', type: :feature, js: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let!(:feature_page1) do
    FactoryBot.create(
      :feature_page,
      title: 'FeaturePage1 Title',
      weight: 1,
      exhibit: exhibit
    )
  end
  let!(:feature_page2) do
    FactoryBot.create(
      :feature_page,
      title: 'FeaturePage2 Title',
      weight: 0,
      exhibit: exhibit
    )
  end

  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }

  before do
    login_as exhibit_curator
  end

  pending 'saves the selected exhibits' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

    click_link('Edit')

    add_widget 'featured_pages'

    fill_in_typeahead_field with: feature_page2.title

    save_page

    expect(page).to have_content feature_page2.title
  end

  pending 'persists the user selected sort order' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

    click_link('Edit')

    add_widget 'featured_pages'

    fill_in_typeahead_field with: feature_page1.title
    fill_in_typeahead_field with: feature_page2.title

    save_page

    feature_page1_position = page.body =~ /<p class="category-title">\s+#{feature_page1.title}/
    feature_page2_position = page.body =~ /<p class="category-title">\s+#{feature_page2.title}/

    expect(feature_page1_position).to be < feature_page2_position
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.4 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-3.0.0.alpha.3 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-3.0.0.alpha.2 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.13.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.12.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.12.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.11.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.10.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.9.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.8.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.7.2 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.7.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.7.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.6.1.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.6.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.6.0 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.5.2 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.5.1 spec/features/javascript/blocks/featured_pages_block_spec.rb
blacklight-spotlight-2.5.0 spec/features/javascript/blocks/featured_pages_block_spec.rb