diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/lib/sidebars/menu_item_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/lib/sidebars/menu_item_spec.rb')
-rw-r--r-- | spec/lib/sidebars/menu_item_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/sidebars/menu_item_spec.rb b/spec/lib/sidebars/menu_item_spec.rb new file mode 100644 index 00000000000..3adde64f550 --- /dev/null +++ b/spec/lib/sidebars/menu_item_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Sidebars::MenuItem do + let(:title) { 'foo' } + let(:html_options) { {} } + let(:menu_item) { described_class.new(title: title, active_routes: {}, link: '', container_html_options: html_options) } + + it 'includes by default aria-label attribute set to the title' do + expect(menu_item.container_html_options).to eq({ aria: { label: title } }) + end + + context 'when aria-label is overridde during initialization' do + let(:html_options) { { aria: { label: 'bar' } } } + + it 'sets the aria-label to the new attribute' do + expect(menu_item.container_html_options).to eq html_options + end + end +end |