Sha256: 26fd88dace6ffb2c235837d6e96f4eede4c79a68b2b794b0a122dbf576cc22b9

Contents?: true

Size: 813 Bytes

Versions: 4

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec.describe Geoblacklight::IconFacetItemComponent, type: :component do
  subject(:rendered) do
    render_inline_to_capybara_node(described_class.new(suppress_link: true, **kwargs))
  end

  let(:kwargs) { { facet_item: facet_item } }
  let(:facet_item) { instance_double(Blacklight::FacetItemPresenter, label: 'Stanford', value: 'stanford', hits: 5, href: nil, selected?: false, facet_config: facet_config) }
  let(:facet_config) { Blacklight::Configuration::FacetField.new(field: 'provider_facet', label: 'Provider') }

  it 'prepends the icon to the facet item label' do
    expect(rendered).to have_selector('span.facet-label', text: 'Stanford')
    expect(rendered).to have_selector('span.facet-label svg title', text: 'Stanford University')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight-4.0.0 spec/components/geoblacklight/icon_facet_item_component_spec.rb
geoblacklight-4.0.0.pre.rc3 spec/components/geoblacklight/icon_facet_item_component_spec.rb
geoblacklight-4.0.0.pre.rc2 spec/components/geoblacklight/icon_facet_item_component_spec.rb
geoblacklight-4.0.0.pre.rc1 spec/components/geoblacklight/icon_facet_item_component_spec.rb