Sha256: 6df74824e6efb7effd7cd6be4966de98ef7846639c7f17bbecff31a9fdc20faa

Contents?: true

Size: 1.72 KB

Versions: 48

Compression:

Stored size: 1.72 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_link "[Missing]"
      end

      within "#facet-subject_geo_ssim" do
        expect(page).to have_selector("span.selected", text: "[Missing")
        expect(page).to have_selector("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_link "[Missing]"
      end

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

      expect(page).not_to have_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_link "[Missing]"
      end

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

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

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
blacklight-7.33.1 spec/features/facet_missing_spec.rb
blacklight-8.0.0.beta4 spec/features/facet_missing_spec.rb
blacklight-8.0.0.beta3 spec/features/facet_missing_spec.rb
blacklight-8.0.0.beta2 spec/features/facet_missing_spec.rb
blacklight-8.0.0.beta1 spec/features/facet_missing_spec.rb
blacklight-7.33.0 spec/features/facet_missing_spec.rb
blacklight-7.32.0 spec/features/facet_missing_spec.rb
blacklight-7.31.0 spec/features/facet_missing_spec.rb
blacklight-7.30.0 spec/features/facet_missing_spec.rb
blacklight-7.29.0 spec/features/facet_missing_spec.rb
blacklight-7.28.0 spec/features/facet_missing_spec.rb
blacklight-7.27.1 spec/features/facet_missing_spec.rb
blacklight-7.27.0 spec/features/facet_missing_spec.rb
blacklight-7.26.1 spec/features/facet_missing_spec.rb
blacklight-7.26.0 spec/features/facet_missing_spec.rb
blacklight-7.25.3 spec/features/facet_missing_spec.rb
blacklight-7.25.2 spec/features/facet_missing_spec.rb
blacklight-7.25.1 spec/features/facet_missing_spec.rb
blacklight-7.25.0 spec/features/facet_missing_spec.rb
blacklight-7.24.0 spec/features/facet_missing_spec.rb