Sha256: f700855f60fc4255a7d45e805cf0575ddf3db739938f21d29383bf92a5576557

Contents?: true

Size: 1.58 KB

Versions: 24

Compression:

Stored size: 1.58 KB

Contents

# frozen_string_literal: true

describe 'Featured Browse Category Block', type: :feature, js: true do
  let(:exhibit) { FactoryBot.create(:exhibit) }
  let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }

  let!(:feature_page) { FactoryBot.create(:feature_page, exhibit: exhibit) }
  let!(:search1) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title1', published: true) }
  let!(:search2) { FactoryBot.create(:published_search, exhibit: exhibit, title: 'Title2', published: true) }

  before do
    login_as exhibit_curator

    visit spotlight.edit_exhibit_feature_page_path(exhibit, feature_page)
    add_widget 'browse'
  end

  pending 'allows a curator to select from existing browse categories' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    check 'Include item counts?'

    fill_in_typeahead_field with: 'Title1'

    within(:css, '.card') do
      uncheck 'Display?'
    end

    fill_in_typeahead_field with: 'Title2'

    save_page

    # Documents should exist
    expect(page).not_to have_css('.category-title', text: search1.title)
    expect(page).to have_css('.category-title', text: search2.title)
    expect(page).to have_css('.item-count', text: /\d+ items/i)
  end

  pending 'allows the curator to omit document counts' do
    pending('Prefetched autocomplete does not work the same way as solr-backed autocompletes')
    uncheck 'Include item counts?'
    fill_in_typeahead_field with: 'Title1'
    save_page

    expect(page).not_to have_css('.item-count', text: /\d+ items/i)
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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