-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#3518] Remove incomplete implementation of menu aria role from Black…
…light::System::DropdownComponent Closes #3518
- Loading branch information
1 parent
3620b34
commit bd1b73e
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
spec/components/blacklight/system/dropdown_component_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe Blacklight::System::DropdownComponent, type: :component do | ||
it 'includes a link for each choice' do | ||
search_state = double(Blacklight::SearchState) | ||
allow(search_state).to receive(:params_for_search).and_return('http://example.com') | ||
rendered = render_inline(described_class.new( | ||
param: :per_page, | ||
choices: [ | ||
['10 per page', 10], | ||
['20 per page', 20] | ||
], | ||
search_state: search_state, | ||
selected: 20, | ||
interpolation: :count | ||
)) | ||
|
||
expect(rendered.css('a').length).to eq 2 | ||
expect(rendered.css('a')[0].text).to eq '10 per page' | ||
expect(rendered.css('a')[0].attributes).not_to have_key 'aria-current' | ||
expect(rendered.css('a')[1].text).to eq '20 per page' | ||
expect(rendered.css('a')[1].attributes).to have_key 'aria-current' | ||
end | ||
end |