Sha256: 8e2ecf566d0fb06e021a7ab44cdd3953aa6b97492d2e8cfa2d25be0415e28230

Contents?: true

Size: 1.7 KB

Versions: 14

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

RSpec.describe "Facet missing" do
  before do
    CatalogController.blacklight_config[:default_solr_params]["facet.missing"] = true
  end

  after do
    CatalogController.blacklight_config[:default_solr_params].delete("facet.missing")
  end

  context "selecting missing field in facets" do
    it "adds facet missing query and constraints" do
      visit root_path

      within "#facet-subject_geo_ssim" do
        click_on "[Missing]"
      end

      within "#facet-subject_geo_ssim" do
        expect(page).to have_css("span.selected", text: "[Missing")
        expect(page).to have_css("span.facet-count.selected", text: "13")
      end

      within "#sortAndPerPage" do
        expect(page).to have_content "1 - 10 of 13"
      end

      expect(page).to have_css(".constraint-value", text: "Region")
      expect(page).to have_css(".constraint-value", text: "[Missing]")
    end
  end

  context "unselecting the facet missing facet" do
    it "unselects the missing field facet" do
      visit root_path

      within "#facet-subject_geo_ssim" do
        click_on "[Missing]"
      end

      within "#facet-subject_geo_ssim" do
        click_on "remove"
      end

      expect(page).to have_no_link "remove"
      expect(page).to have_content("Welcome!")
    end
  end

  context "unselecting the facet missing constraint" do
    it "unselects the missing field facet" do
      visit root_path

      within "#facet-subject_geo_ssim" do
        click_on "[Missing]"
      end

      within ".filter-subject_geo_ssim" do
        click_on "Remove constraint Region: [Missing]"
      end

      expect(page).to have_no_link "remove"
      expect(page).to have_content("Welcome!")
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
blacklight-8.8.4 spec/features/facet_missing_spec.rb
blacklight-8.8.3 spec/features/facet_missing_spec.rb
blacklight-8.8.2 spec/features/facet_missing_spec.rb
blacklight-9.0.0.beta1 spec/features/facet_missing_spec.rb
blacklight-8.8.1 spec/features/facet_missing_spec.rb
blacklight-8.8.0 spec/features/facet_missing_spec.rb
blacklight-8.7.0 spec/features/facet_missing_spec.rb
blacklight-8.6.1 spec/features/facet_missing_spec.rb
blacklight-8.6.0 spec/features/facet_missing_spec.rb
blacklight-8.5.1 spec/features/facet_missing_spec.rb
blacklight-8.5.0 spec/features/facet_missing_spec.rb
blacklight-8.4.0 spec/features/facet_missing_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/features/facet_missing_spec.rb
blacklight-8.3.0 spec/features/facet_missing_spec.rb