Sha256: e5af3e62b8238fe2948e3d6af572d1e101987bb8471f692e55e285041c876832

Contents?: true

Size: 680 Bytes

Versions: 26

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Blacklight::IconHelperBehavior do
  describe '#blacklight_icon' do
    subject(:icon) { helper.blacklight_icon(:search, classes: 'custom-class') }

    it 'returns the svg' do
      expect(icon).to have_css '.blacklight-icons svg'
    end

    it 'adds classes to the wrappering element' do
      expect(icon).to have_css '.custom-class svg'
    end

    context 'with backwards compatible arguments' do
      subject(:icon) { helper.blacklight_icon(:search, aria_hidden: true, label: 'blah') }

      it 'adds aria attributes' do
        expect(icon).to have_css '[aria-hidden="true"][aria-label="blah"]'
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
blacklight-8.8.2 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-9.0.0.beta1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.8.1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.8.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.7.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.6.1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.6.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.5.1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.5.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.4.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.3.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.2.2 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.2.1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.2.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.1.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.0.1 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.0.0 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.0.0.beta8 spec/helpers/blacklight/icon_helper_behavior_spec.rb
blacklight-8.0.0.beta7 spec/helpers/blacklight/icon_helper_behavior_spec.rb